Loading README.md +4 −4 Original line number Diff line number Diff line Loading @@ -69,17 +69,17 @@ print(lpips_clustering(images)) # -1 means noises, the same as that in sklearn ### Object Detection Currently, object detection is supported for anime faces and person, as shown below Currently, object detection is supported for anime heads and person, as shown below * Face Detection * Head Detection   * Person Detection  Based on practical tests, face detection currently has a very stable performance and can be used for automation tasks. Based on practical tests, head detection currently has a very stable performance and can be used for automation tasks. However, person detection is still being further iterated and will focus on enhancing detection capabilities for artistic illustrations in the future. Loading docs/source/api_doc/detect/face.rst→docs/source/api_doc/detect/head.rst +14 −0 Original line number Diff line number Diff line imgutils.detect.face imgutils.detect.head ========================== .. currentmodule:: imgutils.detect.face .. currentmodule:: imgutils.detect.head .. automodule:: imgutils.detect.face .. automodule:: imgutils.detect.head detect_faces detect_heads ------------------------------ .. autofunction:: detect_faces .. autofunction:: detect_heads docs/source/api_doc/detect/face_detect.benchmark.py→docs/source/api_doc/detect/head_detect.benchmark.py +34 −0 Original line number Diff line number Diff line import random from benchmark import BaseBenchmark, create_plot_cli from imgutils.detect import detect_faces from imgutils.detect import detect_heads class FaceDetectBenchmark(BaseBenchmark): class HeadDetectBenchmark(BaseBenchmark): def __init__(self, level): BaseBenchmark.__init__(self) self.level = level def load(self): from imgutils.detect.face import _open_face_detect_model _ = _open_face_detect_model(level=self.level) from imgutils.detect.head import _open_head_detect_model _ = _open_head_detect_model(level=self.level) def unload(self): from imgutils.detect.face import _open_face_detect_model _open_face_detect_model.cache_clear() from imgutils.detect.head import _open_head_detect_model _open_head_detect_model.cache_clear() def run(self): image_file = random.choice(self.all_images) _ = detect_faces(image_file, level=self.level) _ = detect_heads(image_file, level=self.level) if __name__ == '__main__': create_plot_cli( [ ('face (yolov8s)', FaceDetectBenchmark('s')), ('face (yolov8n)', FaceDetectBenchmark('n')), ('head (yolov8s)', HeadDetectBenchmark('s')), ('head (yolov8n)', HeadDetectBenchmark('n')), ], title='Benchmark for Anime Face Detections', title='Benchmark for Anime Head Detections', run_times=10, try_times=20, try_times=5, )() docs/source/api_doc/detect/face_detect.benchmark.py.svg→docs/source/api_doc/detect/head_detect.benchmark.py.svg +394 −370 File changed and moved.Preview size limit exceeded, changes collapsed. Show changes docs/source/api_doc/detect/face_detect.demo.py→docs/source/api_doc/detect/head_detect.demo.py +4 −4 Original line number Diff line number Diff line from imgutils.detect import detect_faces from imgutils.detect import detect_heads from imgutils.detect.visual import detection_visualize from plot import image_plot def _detect(img, **kwargs): return detection_visualize(img, detect_faces(img, **kwargs)) return detection_visualize(img, detect_heads(img, **kwargs)) if __name__ == '__main__': image_plot( (_detect('nian.png'), 'large scale'), (_detect('two_bikini_girls.png'), 'closed faces'), (_detect('two_bikini_girls.png'), 'closed heads'), (_detect('genshin_post.jpg'), 'multiple'), (_detect('mostima_post.jpg'), 'anime style'), save_as='face_detect.dat.svg', save_as='head_detect.dat.svg', columns=2, figsize=(12, 9), ) Loading
README.md +4 −4 Original line number Diff line number Diff line Loading @@ -69,17 +69,17 @@ print(lpips_clustering(images)) # -1 means noises, the same as that in sklearn ### Object Detection Currently, object detection is supported for anime faces and person, as shown below Currently, object detection is supported for anime heads and person, as shown below * Face Detection * Head Detection   * Person Detection  Based on practical tests, face detection currently has a very stable performance and can be used for automation tasks. Based on practical tests, head detection currently has a very stable performance and can be used for automation tasks. However, person detection is still being further iterated and will focus on enhancing detection capabilities for artistic illustrations in the future. Loading
docs/source/api_doc/detect/face.rst→docs/source/api_doc/detect/head.rst +14 −0 Original line number Diff line number Diff line imgutils.detect.face imgutils.detect.head ========================== .. currentmodule:: imgutils.detect.face .. currentmodule:: imgutils.detect.head .. automodule:: imgutils.detect.face .. automodule:: imgutils.detect.head detect_faces detect_heads ------------------------------ .. autofunction:: detect_faces .. autofunction:: detect_heads
docs/source/api_doc/detect/face_detect.benchmark.py→docs/source/api_doc/detect/head_detect.benchmark.py +34 −0 Original line number Diff line number Diff line import random from benchmark import BaseBenchmark, create_plot_cli from imgutils.detect import detect_faces from imgutils.detect import detect_heads class FaceDetectBenchmark(BaseBenchmark): class HeadDetectBenchmark(BaseBenchmark): def __init__(self, level): BaseBenchmark.__init__(self) self.level = level def load(self): from imgutils.detect.face import _open_face_detect_model _ = _open_face_detect_model(level=self.level) from imgutils.detect.head import _open_head_detect_model _ = _open_head_detect_model(level=self.level) def unload(self): from imgutils.detect.face import _open_face_detect_model _open_face_detect_model.cache_clear() from imgutils.detect.head import _open_head_detect_model _open_head_detect_model.cache_clear() def run(self): image_file = random.choice(self.all_images) _ = detect_faces(image_file, level=self.level) _ = detect_heads(image_file, level=self.level) if __name__ == '__main__': create_plot_cli( [ ('face (yolov8s)', FaceDetectBenchmark('s')), ('face (yolov8n)', FaceDetectBenchmark('n')), ('head (yolov8s)', HeadDetectBenchmark('s')), ('head (yolov8n)', HeadDetectBenchmark('n')), ], title='Benchmark for Anime Face Detections', title='Benchmark for Anime Head Detections', run_times=10, try_times=20, try_times=5, )()
docs/source/api_doc/detect/face_detect.benchmark.py.svg→docs/source/api_doc/detect/head_detect.benchmark.py.svg +394 −370 File changed and moved.Preview size limit exceeded, changes collapsed. Show changes
docs/source/api_doc/detect/face_detect.demo.py→docs/source/api_doc/detect/head_detect.demo.py +4 −4 Original line number Diff line number Diff line from imgutils.detect import detect_faces from imgutils.detect import detect_heads from imgutils.detect.visual import detection_visualize from plot import image_plot def _detect(img, **kwargs): return detection_visualize(img, detect_faces(img, **kwargs)) return detection_visualize(img, detect_heads(img, **kwargs)) if __name__ == '__main__': image_plot( (_detect('nian.png'), 'large scale'), (_detect('two_bikini_girls.png'), 'closed faces'), (_detect('two_bikini_girls.png'), 'closed heads'), (_detect('genshin_post.jpg'), 'multiple'), (_detect('mostima_post.jpg'), 'anime style'), save_as='face_detect.dat.svg', save_as='head_detect.dat.svg', columns=2, figsize=(12, 9), )