Scope ultralytics/CLIP imports (#9449)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Glenn Jocher 2024-03-31 19:07:59 +02:00 committed by GitHub
parent 7df821e6ea
commit cd172e9d12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 20 deletions

View file

@ -9,7 +9,7 @@ import numpy as np
import torch
from PIL import Image
from ultralytics.utils import TQDM
from ultralytics.utils import TQDM, checks
class FastSAMPrompt:
@ -33,9 +33,7 @@ class FastSAMPrompt:
try:
import clip
except ImportError:
from ultralytics.utils.checks import check_requirements
check_requirements("git+https://github.com/ultralytics/CLIP.git")
checks.check_requirements("git+https://github.com/ultralytics/CLIP.git")
import clip
self.clip = clip
@ -115,7 +113,8 @@ class FastSAMPrompt:
points (list, optional): Points to be plotted. Defaults to None.
point_label (list, optional): Labels for the points. Defaults to None.
mask_random_color (bool, optional): Whether to use random color for masks. Defaults to True.
better_quality (bool, optional): Whether to apply morphological transformations for better mask quality. Defaults to True.
better_quality (bool, optional): Whether to apply morphological transformations for better mask quality.
Defaults to True.
retina (bool, optional): Whether to use retina mask. Defaults to False.
with_contours (bool, optional): Whether to plot contours. Defaults to True.
"""