Project-MONAI / Project-MONAI/MONAILabel
TestFindContoursd mismatch result when opencv installed
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 891
- Forks
- 269
- Avg merge
- 15h 41m
- Merged PRs (30d)
- 1
Description
_______________________ TestFindContoursd.test_result_0 ________________________
a = (<tests.unit.transform.test_post.TestFindContoursd testMethod=test_result_0>,)
kw = {}
@wraps(func)
def standalone_func(*a, **kw):
> return func(*(a + p.args), **p.kwargs, **kw)
/usr/local/lib/python3.10/dist-packages/parameterized/parameterized.py:620:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/unit/transform/test_post.py:121: in test_result
self.assertEqual(res["result"]["annotation"]["elements"][0]["contours"], expected_output)
E AssertionError: Lists differ: [[[1, 2], [2, 1], [3, 2], [2, 3]], [[1, 1], [1, 3], [3, 3], [3, 1]]] != [[[3, 4], [1, 4], [0, 3], [0, 1], [1, 0], [3, 0], [4, 1], [4, 3], [3, 4]]]
E
E First differing element 0:
E [[1, 2], [2, 1], [3, 2], [2, 3]]
E [[3, 4], [1, 4], [0, 3], [0, 1], [1, 0], [3, 0], [4, 1], [4, 3], [3, 4]]
E
E First list contains 1 additional elements.
E First extra element 1:
E [[1, 1], [1, 3], [3, 3], [3, 1]]
E
E - [[[1, 2], [2, 1], [3, 2], [2, 3]], [[1, 1], [1, 3], [3, 3], [3, 1]]]
E + [[[3, 4], [1, 4], [0, 3], [0, 1], [1, 0], [3, 0], [4, 1], [4, 3], [3, 4]]]
Need to consider the unittest cover the result when opencv installed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running tests/unit/transform/test_post.py and inspect TestFindContoursd.test_result_0. Compare the expected contours with the result produced when OpenCV is installed, then update the unittest coverage so the intended installed-OpenCV behavior is explicit and the test passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- opencv, python
- Domain
- computer-vision, testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100