Commit 8cec3bef authored by narugo1992's avatar narugo1992
Browse files

dev(narugo): shitty rtdetr result, i wont use that again

parent 2e77452e
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
from pprint import pprint

import pytest

from imgutils.detect import detection_similarity
@@ -51,3 +53,16 @@ class TestDetectHead:
            ((461, 247, 536, 330), 'head', 0.434),
        ])
        assert similarity >= 0.85

    @pytest.mark.parametrize(['model_name'], [
        ('head_detect_v1.6_l_rtdetr',),
    ])
    def test_detect_with_rtdetr(self, model_name: str):
        # ATTENTION: results of rtdetr models are really shitty and unstable
        #            so this expected result is 100% bullshit
        #            just make sure the rtdetr models can be properly inferred
        detections = detect_heads(get_testfile('genshin_post.jpg'), model_name=model_name)
        similarity = detection_similarity(detections, [
            ((780, 9, 1125, 208), 'head', 0.3077814280986786)
        ])
        assert similarity >= 0.85