Refactor Python code (#13448)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
6a234f3639
commit
1b26838def
22 changed files with 81 additions and 101 deletions
|
|
@ -25,7 +25,7 @@ class FastSAMPrompt:
|
|||
def __init__(self, source, results, device="cuda") -> None:
|
||||
"""Initializes FastSAMPrompt with given source, results and device, and assigns clip for linear assignment."""
|
||||
if isinstance(source, (str, Path)) and os.path.isdir(source):
|
||||
raise ValueError(f"FastSAM only accepts image paths and PIL Image sources, not directories.")
|
||||
raise ValueError("FastSAM only accepts image paths and PIL Image sources, not directories.")
|
||||
self.device = device
|
||||
self.results = results
|
||||
self.source = source
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue