Spaces:
Sleeping
Sleeping
Commit
·
2a7fc91
1
Parent(s):
7e2bb82
adding text box
Browse files
app.py
CHANGED
|
@@ -11,6 +11,7 @@ from skimage.measure import label, regionprops
|
|
| 11 |
|
| 12 |
processor = CLIPSegProcessor.from_pretrained("CIDAS/clipseg-rd64-refined")
|
| 13 |
model = CLIPSegForImageSegmentation.from_pretrained("CIDAS/clipseg-rd64-refined")
|
|
|
|
| 14 |
|
| 15 |
def rescale_bbox(bbox,orig_image_shape=(1024,1024),model_shape=352):
|
| 16 |
bbox = np.asarray(bbox)/model_shape
|
|
@@ -54,7 +55,6 @@ def display_images(image,detections,prompt='traffic light'):
|
|
| 54 |
def shot(image, labels_text):
|
| 55 |
print("Labels Text ",labels_text)
|
| 56 |
prompts = labels_text.split(',')
|
| 57 |
-
global classes
|
| 58 |
classes = prompts
|
| 59 |
|
| 60 |
print("prompts :",prompts,classes)
|
|
|
|
| 11 |
|
| 12 |
processor = CLIPSegProcessor.from_pretrained("CIDAS/clipseg-rd64-refined")
|
| 13 |
model = CLIPSegForImageSegmentation.from_pretrained("CIDAS/clipseg-rd64-refined")
|
| 14 |
+
global classes
|
| 15 |
|
| 16 |
def rescale_bbox(bbox,orig_image_shape=(1024,1024),model_shape=352):
|
| 17 |
bbox = np.asarray(bbox)/model_shape
|
|
|
|
| 55 |
def shot(image, labels_text):
|
| 56 |
print("Labels Text ",labels_text)
|
| 57 |
prompts = labels_text.split(',')
|
|
|
|
| 58 |
classes = prompts
|
| 59 |
|
| 60 |
print("prompts :",prompts,classes)
|