Skip to content

Commit

Permalink
Merge pull request #41 from deepghs/dev/eye
Browse files Browse the repository at this point in the history
dev(narugo): add eyes detections
  • Loading branch information
narugo1992 authored Sep 26, 2023
2 parents 5644cfb + 49d7431 commit 676e1d6
Show file tree
Hide file tree
Showing 12 changed files with 3,210 additions and 3 deletions.
14 changes: 14 additions & 0 deletions docs/source/api_doc/detect/eye.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
imgutils.detect.eye
==========================

.. currentmodule:: imgutils.detect.eye

.. automodule:: imgutils.detect.eye


detect_eyes
------------------------------

.. autofunction:: detect_eyes


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

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


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

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

def unload(self):
from imgutils.detect.eye import _open_eye_detect_model
_open_eye_detect_model.cache_clear()

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


if __name__ == '__main__':
create_plot_cli(
[
('eye v1.0 (yolov8s)', EyeDetectBenchmark('s', 'v1.0')),
('eye v1.0 (yolov8n)', EyeDetectBenchmark('n', 'v1.0')),
('eye v0.8 (yolov8s)', EyeDetectBenchmark('s', 'v0.8')),
('eye v0.7 (yolov8s)', EyeDetectBenchmark('s', 'v0.7')),
],
title='Benchmark for Anime Eyes Detections',
run_times=10,
try_times=20,
)()
Loading

0 comments on commit 676e1d6

Please sign in to comment.