Hyuto/yolov8-seg-tfjs

How to obtain image data based on mask and crop each object

hktalent opened this issue · 3 comments

How to obtain image data based on mask and crop each object? Thank you very much

Hyuto commented

Hello,

I doubt we can do a lot of these type in JS, but if you want to get the final mask it's on

const mask = tf.tidy(() => {

mask variable contains boolean typed tensor for masking you can crop each object from image using that mask. I don't really know how to do it on JS but in python it's easily done using something like numpy, etc.

@Hyuto sorry,😭I'm not familiar with tfjs, can you teach me?

For example, I would like to see cars and people cropped out

I know Python is easier, but I hope the web can do this job to avoid putting all the computational pressure on the backend