diff --git a/docs/source/api_doc/detect/hand_detect_benchmark.plot.py b/docs/source/api_doc/detect/hand_detect_benchmark.plot.py
index 8a5607e8215..b9d7b3f5786 100644
--- a/docs/source/api_doc/detect/hand_detect_benchmark.plot.py
+++ b/docs/source/api_doc/detect/hand_detect_benchmark.plot.py
@@ -1,34 +1,35 @@
import random
from benchmark import BaseBenchmark, create_plot_cli
-from imgutils.detect import detect_hands
+from imgutils.detect.hand import detect_hands, _REPO_ID
+from imgutils.generic.yolo import _open_models_for_repo_id
+
+_MODELS = _open_models_for_repo_id(_REPO_ID).model_names
class HandDetectBenchmark(BaseBenchmark):
- def __init__(self, version, level):
+ def __init__(self, model_name: str):
BaseBenchmark.__init__(self)
- self.version = version
- self.level = level
+ self.model_name = model_name
def load(self):
- from imgutils.detect.hand import _open_hand_detect_model
- _ = _open_hand_detect_model(version=self.version, level=self.level)
+ from imgutils.generic.yolo import _open_models_for_repo_id
+ _ = _open_models_for_repo_id(_REPO_ID)._open_model(self.model_name)
def unload(self):
- from imgutils.detect.hand import _open_hand_detect_model
- _open_hand_detect_model.cache_clear()
+ from imgutils.generic.yolo import _open_models_for_repo_id
+ _open_models_for_repo_id.cache_clear()
def run(self):
image_file = random.choice(self.all_images)
- _ = detect_hands(image_file, version=self.version, level=self.level)
+ _ = detect_hands(image_file, model_name=self.model_name)
if __name__ == '__main__':
create_plot_cli(
[
- ('hand v0.8 (yolov8s)', HandDetectBenchmark('v0.8', 's')),
- ('hand v1.0 (yolov8s)', HandDetectBenchmark('v1.0', 's')),
- ('hand v1.0 (yolov8n)', HandDetectBenchmark('v1.0', 'n')),
+ (model_name, HandDetectBenchmark(model_name))
+ for model_name in _MODELS
],
title='Benchmark for Anime Hand Detections',
run_times=10,
diff --git a/docs/source/api_doc/detect/hand_detect_benchmark.plot.py.svg b/docs/source/api_doc/detect/hand_detect_benchmark.plot.py.svg
deleted file mode 100644
index 896211e0313..00000000000
--- a/docs/source/api_doc/detect/hand_detect_benchmark.plot.py.svg
+++ /dev/null
@@ -1,2391 +0,0 @@
-
-
-
diff --git a/docs/source/api_doc/detect/person_detect_benchmark.plot.py b/docs/source/api_doc/detect/person_detect_benchmark.plot.py
index 2f59ec09e08..7263b28bcb8 100644
--- a/docs/source/api_doc/detect/person_detect_benchmark.plot.py
+++ b/docs/source/api_doc/detect/person_detect_benchmark.plot.py
@@ -1,38 +1,35 @@
import random
from benchmark import BaseBenchmark, create_plot_cli
-from imgutils.detect import detect_person
+from imgutils.detect.person import detect_person, _REPO_ID
+from imgutils.generic.yolo import _open_models_for_repo_id
+
+_MODELS = _open_models_for_repo_id(_REPO_ID).model_names
class PersonDetectBenchmark(BaseBenchmark):
- def __init__(self, level, version):
+ def __init__(self, model_name: str):
BaseBenchmark.__init__(self)
- self.level = level
- self.version = version
+ self.model_name = model_name
def load(self):
- from imgutils.detect.person import _open_person_detect_model
- _ = _open_person_detect_model(level=self.level, version=self.version)
+ from imgutils.generic.yolo import _open_models_for_repo_id
+ _ = _open_models_for_repo_id(_REPO_ID)._open_model(self.model_name)
def unload(self):
- from imgutils.detect.person import _open_person_detect_model
- _open_person_detect_model.cache_clear()
+ from imgutils.generic.yolo import _open_models_for_repo_id
+ _open_models_for_repo_id.cache_clear()
def run(self):
image_file = random.choice(self.all_images)
- _ = detect_person(image_file, level=self.level, version=self.version)
+ _ = detect_person(image_file, model_name=self.model_name)
if __name__ == '__main__':
create_plot_cli(
[
- ('person v1.1 (yolov8m)', PersonDetectBenchmark('m', 'v1.1')),
- ('person v1.1 (yolov8s)', PersonDetectBenchmark('s', 'v1.1')),
- ('person v1.1 (yolov8n)', PersonDetectBenchmark('n', 'v1.1')),
- ('person v1 (yolov8m)', PersonDetectBenchmark('m', 'v1')),
- ('person v0 (yolov8s)', PersonDetectBenchmark('s', 'v0')),
- ('person v0 (yolov8m)', PersonDetectBenchmark('m', 'v0')),
- ('person v0 (yolov8x)', PersonDetectBenchmark('x', 'v0')),
+ (model_name, PersonDetectBenchmark(model_name))
+ for model_name in _MODELS
],
title='Benchmark for Anime Person Detections',
run_times=10,
diff --git a/docs/source/api_doc/detect/person_detect_benchmark.plot.py.svg b/docs/source/api_doc/detect/person_detect_benchmark.plot.py.svg
deleted file mode 100644
index 3aad18a0d64..00000000000
--- a/docs/source/api_doc/detect/person_detect_benchmark.plot.py.svg
+++ /dev/null
@@ -1,2813 +0,0 @@
-
-
-