Comments (7)
Could modifying autodistill's label
function theoretically fix the problem?
By ensuring that the base conversion is done in COCO and not in YOLO (COCO has more information, so it is simpler to convert COCO to another annotation than the reverse).
# By modifying this code for example, with as_coco instead of as_yolo
dataset.as_yolo(
output_folder + "/images",
output_folder + "/annotations",
min_image_area_percentage=0.01,
data_yaml_path=output_folder + "/data.yaml",
)
Could this work?
from supervision.
Hi @Youho99 👋🏻 The reason might be the disconnected masks generated by GroundedSAM - that is, two separate masks represent one bounding box. The YOLO format does not allow for such a situation, so such objects are split and saved separately. As a result, you end up with more objects.
from supervision.
@SkalskiP
This may indeed be a reason.
But in some cases, I also end up with fewer items.
from supervision.
@Youho99 because sometimes you get detection that gets removed because it is too large or too small. There might be a bug. But I need to see a concrete, reproducible example of something working wrong.
from supervision.
In fact, my goal is to directly convert the dataset into a format that CVAT supports.
CVAT does not support segmentation with the YOLO format, so in any case I will not use it as such.
I will convert to COCO format via Supervision, I will import the annotations to CVAT, and export them to YOLO format from CVAT.
Then I will compare them with the result of the label function of autodistill_grounded_sam.
I will get back to you if there is a difference already on that (probably on the autodistill_grounded_sam repo if there is a problem).
Indeed, there is certainly a bug with the from_yolo for an object generated with autodistill_grounded_sam, but I have no application case to verify the veracity of this (because I am not going to use it as a result).
from supervision.
@SkalskiP
Edit:
I face the same problem with the .as_coco() function to put my dataset in coco format. Except that here, the function crashes because of the difference in detection (1100 versus 900) for the cat image given above.
For other images it doesn't crash, but potentially the problem is just underwater.
I get the error with any image
My first conclusion is that we cannot export a dataset generated via Grounded SAM (autodistill_grounded_sam) at the moment.
# use the code above
results.as_coco(
#images_directory_path=os.path.join("temp_result_coco", 'images'),
annotations_path=os.path.join("temp_result_coco", 'labels.json'))
2024-03-27 10:28:06.724 Uncaught app exception
Traceback (most recent call last):
File "/home/ggiret/miniconda3/envs/deeplabel/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 542, in _run_script
exec(code, module.dict)
File "/home/ggiret/Documents/deeplabel/pages/3_Labels_Generation.py", line 64, in
auto_labeling()
File "/home/ggiret/Documents/deeplabel/backend/labels_generation.py", line 27, in auto_labeling
st.session_state.dataset.as_coco(
File "/home/ggiret/miniconda3/envs/deeplabel/lib/python3.10/site-packages/supervision/dataset/core.py", line 457, in as_coco
save_coco_annotations(
File "/home/ggiret/miniconda3/envs/deeplabel/lib/python3.10/site-packages/supervision/dataset/formats/coco.py", line 218, in save_coco_annotations
coco_annotation, annotation_id = detections_to_coco_annotations(
File "/home/ggiret/miniconda3/envs/deeplabel/lib/python3.10/site-packages/supervision/dataset/formats/coco.py", line 114, in detections_to_coco_annotations
approximate_mask_with_polygons(
IndexError: list index out of range
from supervision.
No longer working with the from_yolo function, I close the issue.
I will reopen this issue if I notice an actual bug with this function.
from supervision.
Related Issues (20)
- [PolygonZone] - drop `frame_resolution_wh` requirement HOT 5
- Interpolation error on computing average precision HOT 3
- Update to support new `from_transformers` methods HOT 1
- [DetectionDataset] - extend `from_coco` and `as_coco` with support for masks in RLE format HOT 10
- the result.mp4 cannot be played on the browser HOT 4
- Adding a function to convert Supervision.Detections to Ultralytics.Results? HOT 2
- Filter Detections Error HOT 7
- TraceAnnotator fails when there are no detections present due to IndexError HOT 7
- I want to filter detections so that only the classes "No Helmet", "Person", "Rider" are detected. HOT 1
- Multi-can tracking HOT 1
- ultralytics_stream_example do not work HOT 8
- ByteTrack memory consumption increases indefinitely HOT 4
- [KeyPoints] - add `from_mediapipe` connector allowing Supervision to be used with Google MediaPipe models HOT 4
- Request: as_coco Parameter Adjustment for sv.DetectionDataset in Supervision API HOT 7
- HaloAnnotator does not work HOT 1
- I want to show zone_annotator all the time
- the update of supervision HOT 3
- small objects detection using sahi or combine it with other models HOT 2
- Saving Detections - Possible Issue? HOT 8
- Smoother Fails Due to Missing tracker_id in Detections HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from supervision.