-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
how to test on a single image and get masks? #39
Comments
From the readme:
Or do you want to export the masks as a numpy array or something? |
@dbolya Thanks, i want to get person's masks in picture, numpy array format |
On this line: Line 150 in a70b68d Add
The masks will be of size If you want a cleaner solution, lmk. This is kind of hacky. |
Much appreciate, Thasnks! |
Please provide a cleaner solution if possible. I am trying to streaming the mask (especially humans) into programs such as Touchdesigner and be able to manipulate that (ie. invisible shader in glsl). I tried the line of code above and use a simple function from pyplot to view it as image but failed:
TypeError: Invalid shape (1, 480, 640) for image data Any suggestions please? Thank you in advance! |
@majinshaoyuindustry matplotlib expects either a 2d image or a 3d image with channels at the end. In your case just use And yeah, I agree these hacks are not very pretty. We're working on a cleaner API (#323) |
Thanks that worked out pretty well. One more question: if I want to export this mask in real-time with a webcam, is there an easy way to create a buffer? Like it will only save 30frames in the folder with the later frames override the earlier ones. |
@majinshaoyuindustry The webcam part is already implement (see the Readme for how to run off a webcam), but you'll have to implement the frame buffer part yourself. Here's where I save the frames: Line 739 in f54b0a5
So you can just replace that line with something special for your buffer. |
No description provided.
The text was updated successfully, but these errors were encountered: