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

Is instance segmentation support planned? #65

Closed
Robotatron opened this issue Oct 12, 2022 · 20 comments
Closed

Is instance segmentation support planned? #65

Robotatron opened this issue Oct 12, 2022 · 20 comments

Comments

@Robotatron
Copy link

Is instance segmentation support planned?
YOLO5 now supports segmentation

@alexheat
Copy link
Contributor

Hi @Robotatron I want to look into this. Would you be able to help? Can you share any resources on the Yolo5 segmentation with segmentation samples in other formats like Coco that would make sense to transform into Yolo?

@mosolab
Copy link

mosolab commented Jan 1, 2023

Hi! Thanks for tool.
I’m interested too and could provide you examples.
Please let me know how to share it.

@alexheat
Copy link
Contributor

alexheat commented Jan 1, 2023 via email

@Robotatron
Copy link
Author

@alexheat

Hi @Robotatron I want to look into this. Would you be able to help? Can you share any resources on the Yolo5 segmentation with segmentation samples in other formats like Coco that would make sense to transform into Yolo?

Sure. Here is an official YOLO5 repo to convert COCO segmentation to YOLO5 format (works with YOLO7 as well) https://github.com/ultralytics/JSON2YOLO/blob/master/general_json2yolo.py

If you'd like to test training a YOLO5 for segmentation it's exactly the same as for object detection but using train.py from their "segment" folder from the repo: https://github.com/ultralytics/yolov5/tree/master/segment

Let me know if there is other information I could help with

@alexheat
Copy link
Contributor

alexheat commented Jan 14, 2023

@Robotatron , @mosolab , I have written a proposal for how I will implement the conversion of segmentation conversion. If you have time please take a look and let me know if you have any feedback #72

@alexheat
Copy link
Contributor

I have release version .44 with support for converting Coco segmentation annotations to Yolo segmentation format. You can see a demonstration in this notebook https://github.com/pylabel-project/samples/blob/main/coco2yolosegmentation.ipynb

@sudheer-palaparambil
Copy link

Thanks @alexheat for your immediate response and time. I downloaded the latest pylabel 0.1.44 and tried with some Coco segmentation annotations (done in makesense.ai). I got some broken annotations in some images. Attached both actual image and PyLabel generated image.
Actual
PyLabel generated

@alexheat
Copy link
Contributor

Thank you @sudheer-palaparambil , can you explain what you mean by broken images? I do not see what is broken. Do you mean the dotted lines? I don't see how those could have been added by PyLabel because it is only touching the annotations.

Can you provide the steps that you are doing to get those lines and the dataset like you did last time? Also, what tool are you using the rendering the images?

@sudheer-palaparambil
Copy link

Hi @alexheat,

I mean that gap in the bottom annotation line.
I executed the following source.

<---------- Beginning
from pylabel import importer
import os

os.makedirs("data", exist_ok=True)
#Specify path to the coco.json file
path_to_annotations = "data/project-22124.json"
#Specify the path to the images (if they are in a different folder than the annotations)
path_to_images = "images/"

#Import the dataset into the pylable schema
dataset = importer.ImportCoco(path_to_annotations, path_to_images=path_to_images, name="Segmentation")
dataset.df.head(5)

dataset.path_to_annotations = "data/yolo"
dataset.export.ExportToYoloV5(segmentation=True)[1]
<----------- End

I copied the labels generated from training\labels folder and uploaded it along with the images to roboflow. The above images are rendered in roboflow. For annotation I used makesense.ai

The first images in the previous mail is rendred when I uploaded images and Coco-JSON generated by makesense.ai

Thank you

@alexheat
Copy link
Contributor

I see it now thank you. Can you share the original annotations as well? I want to investigate what is causing the gap by looking at the actual annotation coordinates

@sudheer-palaparambil
Copy link

Herewith attaching the dataset containing original annotations, PyLabel generated annotations and rendered images as well.
Dataset.zip

@mosolab
Copy link

mosolab commented Jan 18, 2023

@alexheat also on this now. I could convert it but would like also to visualise labelling.
Could converted labelling be visualised with pylabel?

@alexheat
Copy link
Contributor

alexheat commented Jan 18, 2023

Thank you @sudheer-palaparambil , I have released v45 that fixes the issue. The issue was an extra space at the end of each line. I am not sure it it really broke the annotations or just the visual on roboflow but the issue is fixed. Thank you for your help to test it.

@alexheat
Copy link
Contributor

@mosolab, I need to find another package that can visualize these kinds of annotations. But in the meantime you can use the site that sudheer recomended, https://app.roboflow.com/. You can upload the annotations and images and you will see a visualization for each image like this.
image

@mosolab
Copy link

mosolab commented Jan 18, 2023

@alexheat here is my example. looks like not full connected
Screenshot 2023-01-18 at 20 41 04

@alexheat
Copy link
Contributor

alexheat commented Jan 18, 2023 via email

@mosolab
Copy link

mosolab commented Jan 18, 2023

@alexheat, yes, you are right. I had 0.1.44.
Just checked 0.1.45 and it works and looks great!
Thanks for support!

@sudheer-palaparambil
Copy link

@alexheat, sorry for the delayed response. It is working pefectly now. Thanks, keep the good work.

@alexheat
Copy link
Contributor

Thank you everyone

@Robotatron
Copy link
Author

you are awesome, thanks!

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

4 participants