Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extracting Masks #142

Open
IsaiasBahena opened this issue Jun 23, 2024 · 1 comment
Open

Extracting Masks #142

IsaiasBahena opened this issue Jun 23, 2024 · 1 comment

Comments

@IsaiasBahena
Copy link

Can a feature be added that allows you to extract the masks from the videos as well?

@KDeng98
Copy link

KDeng98 commented Jul 9, 2024

Hi there,
If you are still looking for it, here is a tip of enabling it in a previous issue.
#26

Here, you can uncomment this line to save the maks.

# args.mask_save = True

And you can change the mask save directory here.

Track-Anything/app.py

Lines 278 to 285 in 57c28bc

if interactive_state["mask_save"]:
if not os.path.exists('./result/mask/{}'.format(video_state["video_name"].split('.')[0])):
os.makedirs('./result/mask/{}'.format(video_state["video_name"].split('.')[0]))
i = 0
print("save mask")
for mask in video_state["masks"]:
np.save(os.path.join('./result/mask/{}'.format(video_state["video_name"].split('.')[0]), '{:05d}.npy'.format(i)), mask)
i+=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants