Skip to content

Commit

Permalink
Merge pull request #35 from deepghs/dev/hand
Browse files Browse the repository at this point in the history
dev(narugo): add benchmark for hand detection
  • Loading branch information
narugo1992 authored Jul 29, 2023
2 parents 64a5d4b + 24899d4 commit 2cd88ac
Show file tree
Hide file tree
Showing 9 changed files with 2,915 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/source/api_doc/detect/hand.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
imgutils.detect.hand
==========================

.. currentmodule:: imgutils.detect.hand

.. automodule:: imgutils.detect.hand


detect_hands
------------------------------

.. autofunction:: detect_hands


36 changes: 36 additions & 0 deletions docs/source/api_doc/detect/hand_detect_benchmark.plot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import random

from benchmark import BaseBenchmark, create_plot_cli
from imgutils.detect import detect_hands


class HandDetectBenchmark(BaseBenchmark):
def __init__(self, version, level):
BaseBenchmark.__init__(self)
self.version = version
self.level = level

def load(self):
from imgutils.detect.hand import _open_hand_detect_model
_ = _open_hand_detect_model(version=self.version, level=self.level)

def unload(self):
from imgutils.detect.hand import _open_hand_detect_model
_open_hand_detect_model.cache_clear()

def run(self):
image_file = random.choice(self.all_images)
_ = detect_hands(image_file, version=self.version, level=self.level)


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')),
],
title='Benchmark for Anime Hand Detections',
run_times=10,
try_times=20,
)()
Loading

0 comments on commit 2cd88ac

Please sign in to comment.