Spaces:
Runtime error
Runtime error
kushagra124
commited on
Commit
•
be8d3e7
1
Parent(s):
58ed3f4
adding example
Browse files- Clip_model_notebook.ipynb +0 -0
- app.py +3 -1
Clip_model_notebook.ipynb
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
app.py
CHANGED
@@ -66,7 +66,9 @@ def visualize_images(image,detections,prompt):
|
|
66 |
|
67 |
|
68 |
def shot(image, labels_text,selected_categoty):
|
69 |
-
prompts = labels_text.
|
|
|
|
|
70 |
model_detections = detect_using_clip(image,prompts=prompts)
|
71 |
category_image = visualize_images(image=image,detections=model_detections,prompt=selected_categoty)
|
72 |
return category_image
|
|
|
66 |
|
67 |
|
68 |
def shot(image, labels_text,selected_categoty):
|
69 |
+
prompts = labels_text.split(',')
|
70 |
+
prompts = list(map(lambda x: x.strip(),prompts))
|
71 |
+
|
72 |
model_detections = detect_using_clip(image,prompts=prompts)
|
73 |
category_image = visualize_images(image=image,detections=model_detections,prompt=selected_categoty)
|
74 |
return category_image
|