update app
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import re
|
|
| 6 |
def dino_inference(image, text):
|
| 7 |
print("Image: ", image)
|
| 8 |
print("Text: ", text)
|
| 9 |
-
new_path = re.sub(r'^.+/([^/]+)$', r'
|
| 10 |
new_path = re.sub(r'\.jpeg$', '.jpg', new_path)
|
| 11 |
|
| 12 |
model = load_model("groundingdino/config/GroundingDINO_SwinT_OGC.py",
|
|
@@ -26,9 +26,6 @@ def dino_inference(image, text):
|
|
| 26 |
text_threshold=TEXT_TRESHOLD
|
| 27 |
)
|
| 28 |
|
| 29 |
-
# results = model.predict(source=image)
|
| 30 |
-
# annotated_image = results[0].plot()
|
| 31 |
-
# return annotated_image[:, :, ::-1], None
|
| 32 |
annotated_frame = annotate(image_source=image_source, boxes=boxes, logits=logits, phrases=phrases)
|
| 33 |
print("Annotated frame shape: ", annotated_frame.shape)
|
| 34 |
cv2.imwrite("annotated_image.jpg", annotated_frame)
|
|
|
|
| 6 |
def dino_inference(image, text):
|
| 7 |
print("Image: ", image)
|
| 8 |
print("Text: ", text)
|
| 9 |
+
new_path = re.sub(r'^.+/([^/]+)$', r'.asset/train/\1', image)
|
| 10 |
new_path = re.sub(r'\.jpeg$', '.jpg', new_path)
|
| 11 |
|
| 12 |
model = load_model("groundingdino/config/GroundingDINO_SwinT_OGC.py",
|
|
|
|
| 26 |
text_threshold=TEXT_TRESHOLD
|
| 27 |
)
|
| 28 |
|
|
|
|
|
|
|
|
|
|
| 29 |
annotated_frame = annotate(image_source=image_source, boxes=boxes, logits=logits, phrases=phrases)
|
| 30 |
print("Annotated frame shape: ", annotated_frame.shape)
|
| 31 |
cv2.imwrite("annotated_image.jpg", annotated_frame)
|