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

YoloV7 serverless detector feature for auto annotation #5552

Merged
merged 10 commits into from
Jan 10, 2023
Merged

YoloV7 serverless detector feature for auto annotation #5552

merged 10 commits into from
Jan 10, 2023

Conversation

hardikdava
Copy link
Contributor

Motivation and context

Integration of YOLOv7 as a serverless nuclio function that can be used for auto-labeling. YoloV7 is the SOTA at the time of this PR therefore it would make sense to support it in CVAT. The integration is quite simple into CVAT as docker based on Ultralytics YoloV5 with coco pretrained model (https://github.com/WongKinYiu/yolov7) and a docker image (https://hub.docker.com/r/ultralytics/yolov5).

related issue: #5548

How has this been tested?

Automatic annotation was run using YOLOv7 on a custom dataset.
The serverless function was deployed using

nuctl deploy --project-name cvat \
  --path serverless/onnx/WongKinYiu/yolov7/nuclio \
  --volume `pwd`/serverless/common:/opt/nuclio/common \
  --platform local

Then using the 'Automatic annotation' action the function was tested and the auto-generated labels were controlled to check that no coordinates misfit is happening.

Checklist

Use custom model:

  1. Export your model with NMS for image resolution of 640x640 (preferable).
  2. Copy your custom model yolov7-custom.onnx to /serverless/common
  3. Modify function.yaml file according to your labels.
  4. Modify model_handler.py as follow:
 self.model_path = "yolov7-custom.onnx"

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

@nmanovic nmanovic added the models label Jan 6, 2023
@nmanovic
Copy link
Contributor

nmanovic commented Jan 6, 2023

@hardikdava , thanks for the contribution!

@nmanovic
Copy link
Contributor

nmanovic commented Jan 6, 2023

@hardikdava , could you please help us to fix remark and pylint linters?

Archives with logs can be found here: https://github.com/opencv/cvat/actions/runs/3858059000 and https://github.com/opencv/cvat/actions/runs/3858058989
See artifacts section.

@nmanovic nmanovic requested review from yasakova-anastasia and removed request for nmanovic January 10, 2023 12:34
Copy link
Contributor

@yasakova-anastasia yasakova-anastasia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on CPU, it works for me. LGTM.

@nmanovic nmanovic merged commit f3843aa into cvat-ai:develop Jan 10, 2023
mikhail-treskin pushed a commit to retailnext/cvat that referenced this pull request Jul 1, 2023
### Motivation and context

Integration of YOLOv7 as a serverless nuclio function that can be used
for auto-labeling. YoloV7 is the SOTA at the time of this PR therefore
it would make sense to support it in CVAT. The integration is quite
simple into CVAT as docker based on Ultralytics YoloV5 with coco
pretrained model (https://github.com/WongKinYiu/yolov7) and a docker
image (https://hub.docker.com/r/ultralytics/yolov5).

related issue: cvat-ai#5548 

### How has this been tested?

Automatic annotation was run using YOLOv7 on a custom dataset.
The serverless function was deployed using

```
nuctl deploy --project-name cvat \
  --path serverless/onnx/WongKinYiu/yolov7/nuclio \
  --volume `pwd`/serverless/common:/opt/nuclio/common \
  --platform local
```

Then using the 'Automatic annotation' action the function was tested and
the auto-generated labels were controlled to check that no coordinates
misfit is happening.

### Use custom model:
1. Export your model with NMS for image resolution of 640x640
(preferable).
2. Copy your custom model yolov7-custom.onnx to /serverless/common
3. Modify function.yaml file according to your labels.
4. Modify model_handler.py as follow:
```
 self.model_path = "yolov7-custom.onnx"
```

Co-authored-by: Nikita Manovich <nikita@cvat.ai>
Co-authored-by: yasakova-anastasia <yasakova_anastasiya@mail.ru>
@jpfleischer
Copy link

Great! I deeply appreciate this PR. Does anyone know how we can tweak the parameters, like decrease the confidence interval? Or how can we even use yolov8 in cvat's auto annotation?

Thanks

@hardikdava hardikdava mentioned this pull request Jul 13, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants