cvat
cvat copied to clipboard
Update model_handler.py
use the OpenCV contour function to extract contour instead of scikit-image function. to solve the problem of poor drawing of the contour see the issue 4660 https://github.com/openvinotoolkit/cvat/issues/4660
Motivation and context
How has this been tested?
Checklist
- [x] I submit my changes into the
develop
branch - [x] I have added a description of my changes into CHANGELOG file
- [ ] I have updated the documentation accordingly
- [ ] I have added tests to cover my changes
- [ ] I have linked related issues (read github docs)
- [ ] I have increased versions of npm packages if it is necessary (cvat-canvas, cvat-core, cvat-data and cvat-ui)
License
- [x] 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.
- [x] I have updated the license header for each file (see an example below)
# Copyright (C) 2022 Intel Corporation
#
# SPDX-License-Identifier: MIT
https://github.com/openvinotoolkit/cvat/issues/4660
Hi, @waqarsqureshi
Do you think we need it if CVAT can support working with masks now? https://github.com/opencv/cvat/pull/4543
@bsekachev The function that i proposed is when we use automated masking using an existing semantic segmentation. If CVAT is already using this function then it is fine.
Use the following
contours, hierarchy = cv2.findContours(mask_by_label, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE
instead
contours = find_contours(mask_by_label, 0.5)
@yasakova-anastasia , could you please look at the PR and give your feedback?
It really works better for semantic segmentation.
Great! to see it resolved!
@waqarsqureshi , thanks for your contribution.