| 19 | |
| 20 | |
| 21 | def test_only_captcha(detector: Detector): |
| 22 | img_bytes = image_dir.joinpath("only_captcha.png").read_bytes() |
| 23 | response, coordinates = detector.detect("motorcycle", img_bytes, area_captcha=True) |
| 24 | |
| 25 | # General Checks |
| 26 | assert response, coordinates |
| 27 | assert len(response) == 16 |
| 28 | |
| 29 | # Response Correctness |
| 30 | assert sum(response) == len(coordinates) |
| 31 | assert response == [ |
| 32 | True, |
| 33 | True, |
| 34 | True, |
| 35 | False, |
| 36 | True, |
| 37 | True, |
| 38 | True, |
| 39 | False, |
| 40 | False, |
| 41 | True, |
| 42 | True, |
| 43 | False, |
| 44 | False, |
| 45 | False, |
| 46 | False, |
| 47 | False, |
| 48 | ] |
| 49 | |
| 50 | |
| 51 | def test_area_yolo_captcha(detector: Detector): |