Skip to content

Added semgrep and some fixes #128

Added semgrep and some fixes

Added semgrep and some fixes #128

GitHub Actions / Test Results failed Feb 26, 2025 in 0s

2 fail, 22 skipped, 71 pass in 2h 38m 50s

  5 files  + 1    5 suites  +1   2h 38m 50s ⏱️ + 18m 18s
 95 tests ± 0   71 ✅ + 5   22 💤  -  6   2 ❌ +1 
462 runs  +82  319 ✅ +56  133 💤 +17  10 ❌ +9 

Results for commit af8c66a. ± Comparison against earlier commit 832df05.

Annotations

Check warning on line 0 in tests.core_tests.unittests.test_annotators

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 5 runs failed: test_cpu_owlv2_annotator_text (tests.core_tests.unittests.test_annotators)

artifacts/Test Results [buildjet-8vcpu-ubuntu-2204] (Python 3.10)/pytest.xml [took 2s]
artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 11s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 11s]
artifacts/Test Results [windows-latest] (Python 3.10)/pytest.xml [took 3s]
artifacts/Test Results [windows-latest] (Python 3.11)/pytest.xml [took 6s]
Raw output
TypeError: a bytes-like object is required, not 'HTTPResponse'
@pytest.mark.skipif(
        total_disk_space < 16,
        reason="Test requires at least 16GB of HDD",
    )
    def test_cpu_owlv2_annotator_text():
>       _check_owlv2_annotator("cpu", use_text_prompts=True)

tests\core_tests\unittests\test_annotators.py:74: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

device = 'cpu', size = 'base', use_text_prompts = True

    def _check_owlv2_annotator(
        device: str, size: str = "base", use_text_prompts: bool = True
    ):
        annotator = OWLv2Annotator(device=device, size=size)
    
        if use_text_prompts:
            url = "https://ultralytics.com/images/bus.jpg"
>           im = Image.open(BytesIO(requests.get(url, stream=True).raw))
E           TypeError: a bytes-like object is required, not 'HTTPResponse'

tests\core_tests\unittests\test_annotators.py:30: TypeError

Check warning on line 0 in tests.core_tests.unittests.test_annotators

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 5 runs failed: test_cpu_owlv2_annotator_image (tests.core_tests.unittests.test_annotators)

artifacts/Test Results [buildjet-8vcpu-ubuntu-2204] (Python 3.10)/pytest.xml [took 1s]
artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 1s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 1s]
artifacts/Test Results [windows-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.11)/pytest.xml [took 1s]
Raw output
TypeError: a bytes-like object is required, not 'HTTPResponse'
@pytest.mark.skipif(
        total_disk_space < 16,
        reason="Test requires at least 16GB of HDD",
    )
    def test_cpu_owlv2_annotator_image():
>       _check_owlv2_annotator("cpu", use_text_prompts=False)

tests\core_tests\unittests\test_annotators.py:90: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

device = 'cpu', size = 'base', use_text_prompts = False

    def _check_owlv2_annotator(
        device: str, size: str = "base", use_text_prompts: bool = True
    ):
        annotator = OWLv2Annotator(device=device, size=size)
    
        if use_text_prompts:
            url = "https://ultralytics.com/images/bus.jpg"
            im = Image.open(BytesIO(requests.get(url, stream=True).raw))
            final_boxes, final_scores, final_labels = annotator.annotate_batch(
                [im], ["bus", "people"]
            )
        else:
            url = "http://images.cocodataset.org/val2017/000000039769.jpg"
>           im = Image.open(BytesIO(requests.get(url, stream=True).raw))
E           TypeError: a bytes-like object is required, not 'HTTPResponse'

tests\core_tests\unittests\test_annotators.py:36: TypeError