Unverified Commit 4967a9b1 authored by narugo1992's avatar narugo1992 Committed by GitHub
Browse files

Merge pull request #129 from deepghs/dev/yolo

dev(narugo): use static input size for yolo models
parents 7df7bf5b 9f7019be
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -180,7 +180,7 @@ _REPO_ID = 'deepghs/booru_yolo'


def detect_with_booru_yolo(image: ImageTyping, model_name: str = _DEFAULT_MODEL,
                           conf_threshold: float = 0.25, iou_threshold: float = 0.7) \
                           conf_threshold: float = 0.25, iou_threshold: float = 0.7, **kwargs) \
        -> List[Tuple[Tuple[int, int, int, int], str, float]]:
    """
    Perform object detection on an image using the Booru YOLO model.
@@ -209,4 +209,5 @@ def detect_with_booru_yolo(image: ImageTyping, model_name: str = _DEFAULT_MODEL,
        model_name=model_name,
        conf_threshold=conf_threshold,
        iou_threshold=iou_threshold,
        **kwargs,
    )
+2 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ _REPO_ID = 'deepghs/anime_censor_detection'


def detect_censors(image: ImageTyping, level: str = 's', version: str = 'v1.0', model_name: Optional[str] = None,
                   conf_threshold: float = 0.3, iou_threshold: float = 0.7) \
                   conf_threshold: float = 0.3, iou_threshold: float = 0.7, **kwargs) \
        -> List[Tuple[Tuple[int, int, int, int], str, float]]:
    """
    Detect human censor points in anime images.
@@ -88,4 +88,5 @@ def detect_censors(image: ImageTyping, level: str = 's', version: str = 'v1.0',
        model_name=model_name or f'censor_detect_{version}_{level}',
        conf_threshold=conf_threshold,
        iou_threshold=iou_threshold,
        **kwargs,
    )
+2 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ _REPO_ID = 'deepghs/anime_eye_detection'


def detect_eyes(image: ImageTyping, level: str = 's', version: str = 'v1.0', model_name: Optional[str] = None,
                conf_threshold: float = 0.3, iou_threshold: float = 0.3) \
                conf_threshold: float = 0.3, iou_threshold: float = 0.3, **kwargs) \
        -> List[Tuple[Tuple[int, int, int, int], str, float]]:
    """
    Detect human eyes in anime images.
@@ -79,4 +79,5 @@ def detect_eyes(image: ImageTyping, level: str = 's', version: str = 'v1.0', mod
        model_name=model_name or f'eye_detect_{version}_{level}',
        conf_threshold=conf_threshold,
        iou_threshold=iou_threshold,
        **kwargs,
    )
+2 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ _REPO_ID = 'deepghs/anime_face_detection'


def detect_faces(image: ImageTyping, level: str = 's', version: str = 'v1.4', model_name: Optional[str] = None,
                 conf_threshold: float = 0.25, iou_threshold: float = 0.7) \
                 conf_threshold: float = 0.25, iou_threshold: float = 0.7, **kwargs) \
        -> List[Tuple[Tuple[int, int, int, int], str, float]]:
    """
    Detect human faces in anime images using YOLOv8 models.
@@ -87,4 +87,5 @@ def detect_faces(image: ImageTyping, level: str = 's', version: str = 'v1.4', mo
        model_name=model_name or f'face_detect_{version}_{level}',
        conf_threshold=conf_threshold,
        iou_threshold=iou_threshold,
        **kwargs,
    )
+2 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ _REPO_ID = 'deepghs/anime_halfbody_detection'


def detect_halfbody(image: ImageTyping, level: str = 's', version: str = 'v1.0', model_name: Optional[str] = None,
                    conf_threshold: float = 0.5, iou_threshold: float = 0.7) \
                    conf_threshold: float = 0.5, iou_threshold: float = 0.7, **kwargs) \
        -> List[Tuple[Tuple[int, int, int, int], str, float]]:
    """
    Detect human upper-half body in anime images.
@@ -87,4 +87,5 @@ def detect_halfbody(image: ImageTyping, level: str = 's', version: str = 'v1.0',
        model_name=model_name or f'halfbody_detect_{version}_{level}',
        conf_threshold=conf_threshold,
        iou_threshold=iou_threshold,
        **kwargs,
    )
Loading