Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,14 +19,6 @@ extract_model = YOLO("best.pt").to(device)
|
|
| 19 |
detect_model = YOLO("yolov8n.pt").to(device)
|
| 20 |
|
| 21 |
|
| 22 |
-
def caption_image_with_llava(image_path):
|
| 23 |
-
image = Image.open(image_path).convert("RGB")
|
| 24 |
-
prompt = "[INST] <image>\nDescribe what is visible in the image in a concise, factual sentence. [/INST]"
|
| 25 |
-
inputs = processor(prompt, images=image, return_tensors="pt").to(device)
|
| 26 |
-
outputs = llava.generate(**inputs, max_new_tokens=100, do_sample=False)
|
| 27 |
-
caption = processor.decode(outputs[0], skip_special_tokens=True)
|
| 28 |
-
return caption
|
| 29 |
-
|
| 30 |
@spaces.GPU
|
| 31 |
def process_video(video_path):
|
| 32 |
os.makedirs("frames", exist_ok=True)
|
|
|
|
| 19 |
detect_model = YOLO("yolov8n.pt").to(device)
|
| 20 |
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
@spaces.GPU
|
| 23 |
def process_video(video_path):
|
| 24 |
os.makedirs("frames", exist_ok=True)
|