cvdfoundation / fashionpedia

128 stars 14 forks source link

Remove Background of Image #6

Open firaki12345-cmd opened 2 years ago

firaki12345-cmd commented 2 years ago

Hi, so i have been playing with instance segmentation for the past week and cam around this library called Pixel lib

https://pixellib.readthedocs.io/en/latest/Image_instance.html

which is amazing at Instance Segmentation with few lines of Code.

Now it works on People,animals but has a problem on Fashion (Especially Shoes Dataset)

So, I Finally found the Fashion Pedia dataset and annotations but how can i use it with Pixel lib ?

My Code on Kaggle:

pip install pixellib

import pixellib

from pixellib.instance import instance_segmentation  

from matplotlib import pyplot as plt

!wget "https://github.com/matterport/Mask_RCNN/releases/download/v2.0/mask_rcnn_coco.h5"

segmentation_model = instance_segmentation()

segmentation_model.load_model("./mask_rcnn_coco.h5")

segmask,output = segmentation_model.segmentImage("../input/facess/8.jpg", extract_segmented_objects = True, save_extracted_objects = True, show_bboxes = True, output_image_name = "output1.jpg")

plt.imshow(Image.open("./segmented_object_1.jpg"))

https://i.postimg.cc/BbnzTW4j/Screenshot-2021-10-26-at-18-53-53-notebook7bd3db2b2e-Kaggle.png

The below image i want to do image segmentation ? how can i do that ?

https://i.postimg.cc/bNGCp9Jf/116.jpg

Thanks

KMnP commented 1 year ago

Hi, I'm not familiar with pixellib, but seems like the solution is first you need to train a model with Fashionpedia dataset, and then use it in you case.

Hope this helps!!