cvat icon indicating copy to clipboard operation
cvat copied to clipboard

Update model_handler.py

Open waqarsqureshi opened this issue 2 years ago • 4 comments

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

waqarsqureshi avatar May 31 '22 13:05 waqarsqureshi

https://github.com/openvinotoolkit/cvat/issues/4660

waqarsqureshi avatar May 31 '22 13:05 waqarsqureshi

Hi, @waqarsqureshi

Do you think we need it if CVAT can support working with masks now? https://github.com/opencv/cvat/pull/4543

bsekachev avatar Oct 31 '22 09:10 bsekachev

@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)

waqarsqureshi avatar Nov 01 '22 13:11 waqarsqureshi

@yasakova-anastasia , could you please look at the PR and give your feedback?

nmanovic avatar Nov 17 '22 15:11 nmanovic

It really works better for semantic segmentation.

Screenshot from 2023-01-11 16-46-47 Screenshot from 2023-01-11 16-46-28 Screenshot from 2023-01-11 16-54-48 Screenshot from 2023-01-11 16-50-59

yasakova-anastasia avatar Jan 11 '23 14:01 yasakova-anastasia

Great! to see it resolved!

waqarsqureshi avatar Jan 11 '23 15:01 waqarsqureshi

@waqarsqureshi , thanks for your contribution.

nmanovic avatar Jan 11 '23 18:01 nmanovic