Initial commit

This commit is contained in:
2026-11-26 16:53:02 +05:30
commit 54eab69fe2
70 changed files with 75490 additions and 0 deletions
Binary file not shown.
+16
View File
@@ -0,0 +1,16 @@
flowchart TD
A[Image or Video Input] --> B[Streamlit Application]
B --> C[Custom Text Prompt and Confidence Threshold]
C --> D{Select Detection Model}
D --> E[Grounding DINO]
D --> F[YOLO-World]
E --> G[Object Detection Processing]
F --> G
G --> H[Bounding Boxes and Confidence Scores]
H --> I[Object Labels and Counts]
I --> J[Annotated Image or Video Output]
J --> K[Performance Evaluation]
K --> L[CPU RAM GPU and VRAM]
K --> M[Inference Time and FPS]
L --> N[CSV Benchmark Results]
M --> N
Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

+350
View File
@@ -0,0 +1,350 @@
#!/usr/bin/env python3
"""
Ground-truth annotation + evaluation for Grounding DINO and YOLO-World.
Run from the Open_Vocabulary project directory:
source venv/bin/activate
python evaluate_models.py
The script opens each original image and asks you to draw one ground-truth
box per listed target. Press ENTER/SPACE to accept each box. Press C to cancel
and retry. The script then runs both models and writes evaluation CSV files.
"""
import csv
import json
import time
from pathlib import Path
import cv2
import numpy as np
import torch
from PIL import Image
from transformers import AutoProcessor, AutoModelForZeroShotObjectDetection
from ultralytics import YOLOWorld
SCRIPT_DIR = Path(__file__).resolve().parent
ROOT = SCRIPT_DIR.parent if SCRIPT_DIR.name == "reports" else SCRIPT_DIR
IMAGE_DIR = ROOT / "sample_images" / "Original_Images"
ANNOTATION_FILE = ROOT / "reports" / "ground_truth_annotations.json"
RESULTS_DIR = ROOT / "reports" / "evaluation"
DINO_ID = "IDEA-Research/grounding-dino-tiny"
YOLO_WEIGHTS = ROOT / "yolov8s-world.pt"
CLASSES_BY_IMAGE = {
"sample_1.png": ["person", "safety helmet"],
"sample_2.png": ["safety helmet"],
"sample_3.png": ["mobile phone"],
"sample_4.png": ["laptop"],
"sample_5.png": ["traffic cone"],
"sample_6.png": ["caliper"],
"sample_7.png": ["pipe wrench"],
"sample_8.png": ["soldering iron"],
}
CLASSES = sorted({c for labels in CLASSES_BY_IMAGE.values() for c in labels})
EVAL_CONFIDENCE = 0.25
IOU_THRESHOLDS = [round(x, 2) for x in np.arange(0.50, 0.96, 0.05)]
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
def annotate_ground_truth():
"""Create boxes using OpenCV's interactive ROI selector."""
annotations = {}
print("\nGROUND-TRUTH ANNOTATION")
print("For each displayed target, drag a tight rectangle around the object.")
print("Press ENTER/SPACE to accept the box; C cancels the current selection.\n")
for filename, labels in CLASSES_BY_IMAGE.items():
path = IMAGE_DIR / filename
if not path.exists():
raise FileNotFoundError(f"Missing image: {path}")
image = cv2.imread(str(path))
if image is None:
raise RuntimeError(f"Could not read image: {path}")
h, w = image.shape[:2]
image_annotations = []
for label in labels:
display = image.copy()
cv2.putText(
display, f"{filename}: select the {label}",
(5, 18), cv2.FONT_HERSHEY_SIMPLEX, 0.45, (0, 0, 255), 1,
cv2.LINE_AA
)
print(f"{filename}: draw a box around '{label}' ({w}x{h})")
while True:
x, y, bw, bh = cv2.selectROI(
"Ground Truth Annotation", display,
showCrosshair=True, fromCenter=False
)
if bw > 0 and bh > 0:
break
print("No box selected. Please select the object.")
x1, y1 = int(x), int(y)
x2, y2 = int(x + bw), int(y + bh)
image_annotations.append({
"class": label,
"bbox_xyxy": [x1, y1, x2, y2]
})
cv2.rectangle(display, (x1, y1), (x2, y2), (0, 255, 0), 2)
annotations[filename] = {
"width": w, "height": h, "objects": image_annotations
}
print(f" Saved {len(image_annotations)} box(es) for {filename}")
cv2.destroyAllWindows()
ANNOTATION_FILE.parent.mkdir(parents=True, exist_ok=True)
ANNOTATION_FILE.write_text(json.dumps(annotations, indent=2))
print(f"\nGround truth saved to: {ANNOTATION_FILE}")
return annotations
def load_annotations():
if ANNOTATION_FILE.exists():
answer = input(
f"Existing annotations found at {ANNOTATION_FILE}.\n"
"Reuse them? [Y/n]: "
).strip().lower()
if answer in ("", "y", "yes"):
return json.loads(ANNOTATION_FILE.read_text())
return annotate_ground_truth()
def normalize_label(label):
return " ".join(str(label).lower().replace("_", " ").replace("-", " ").split())
def run_dino(image, labels, processor, model):
prompt = ". ".join(labels) + "."
inputs = processor(images=image, text=prompt, return_tensors="pt").to(DEVICE)
if DEVICE == "cuda":
torch.cuda.synchronize()
start = time.perf_counter()
with torch.inference_mode():
outputs = model(**inputs)
if DEVICE == "cuda":
torch.cuda.synchronize()
elapsed_ms = (time.perf_counter() - start) * 1000
result = processor.post_process_grounded_object_detection(
outputs, inputs.input_ids,
threshold=0.001,
text_threshold=0.25,
target_sizes=[(image.height, image.width)]
)[0]
labels_out = result.get("text_labels", result.get("labels", []))
detections = []
for box, score, label in zip(result["boxes"], result["scores"], labels_out):
detections.append({
"class": normalize_label(label),
"confidence": float(score),
"bbox_xyxy": [float(v) for v in box.tolist()]
})
return detections, elapsed_ms
def run_yolo(image, labels, model):
model.set_classes(labels)
if DEVICE == "cuda":
torch.cuda.synchronize()
start = time.perf_counter()
results = model.predict(
source=image, device=0 if DEVICE == "cuda" else "cpu",
conf=0.001, imgsz=640, verbose=False
)
if DEVICE == "cuda":
torch.cuda.synchronize()
elapsed_ms = (time.perf_counter() - start) * 1000
result = results[0]
detections = []
if result.boxes is not None:
for box in result.boxes:
class_id = int(box.cls[0])
detections.append({
"class": normalize_label(result.names[class_id]),
"confidence": float(box.conf[0]),
"bbox_xyxy": [float(v) for v in box.xyxy[0].tolist()]
})
return detections, elapsed_ms
def iou_xyxy(a, b):
x1 = max(a[0], b[0])
y1 = max(a[1], b[1])
x2 = min(a[2], b[2])
y2 = min(a[3], b[3])
inter = max(0.0, x2 - x1) * max(0.0, y2 - y1)
area_a = max(0.0, a[2] - a[0]) * max(0.0, a[3] - a[1])
area_b = max(0.0, b[2] - b[0]) * max(0.0, b[3] - b[1])
union = area_a + area_b - inter
return inter / union if union > 0 else 0.0
def evaluate_at_iou(predictions, annotations, class_name, iou_threshold):
gt_by_image = {}
total_gt = 0
for filename, data in annotations.items():
boxes = [
obj["bbox_xyxy"] for obj in data["objects"]
if normalize_label(obj["class"]) == class_name
]
gt_by_image[filename] = boxes
total_gt += len(boxes)
preds = []
for filename, detections in predictions.items():
for det in detections:
if normalize_label(det["class"]) == class_name and det["confidence"] >= EVAL_CONFIDENCE:
preds.append((det["confidence"], filename, det["bbox_xyxy"]))
preds.sort(key=lambda x: x[0], reverse=True)
matched = {filename: set() for filename in gt_by_image}
tp_flags, fp_flags = [], []
tp = 0
for confidence, filename, box in preds:
candidates = gt_by_image.get(filename, [])
best_iou, best_idx = 0.0, -1
for idx, gt_box in enumerate(candidates):
if idx in matched[filename]:
continue
overlap = iou_xyxy(box, gt_box)
if overlap > best_iou:
best_iou, best_idx = overlap, idx
if best_idx >= 0 and best_iou >= iou_threshold:
matched[filename].add(best_idx)
tp += 1
tp_flags.append(1)
fp_flags.append(0)
else:
tp_flags.append(0)
fp_flags.append(1)
fp = len(preds) - tp
fn = total_gt - tp
precision = tp / (tp + fp) if tp + fp else 0.0
recall = tp / total_gt if total_gt else 0.0
f1 = 2 * precision * recall / (precision + recall) if precision + recall else 0.0
# 101-point interpolated AP; no-GT classes are excluded from mAP.
ap = None
if total_gt:
if preds:
tp_cum = np.cumsum(tp_flags)
fp_cum = np.cumsum(fp_flags)
recalls = tp_cum / total_gt
precisions = tp_cum / np.maximum(tp_cum + fp_cum, 1)
interpolated = []
for recall_level in np.linspace(0, 1, 101):
valid = precisions[recalls >= recall_level]
interpolated.append(float(valid.max()) if len(valid) else 0.0)
ap = float(np.mean(interpolated))
else:
ap = 0.0
return {
"TP": tp, "FP": fp, "FN": fn,
"Precision": precision, "Recall": recall, "F1": f1, "AP": ap
}
def main():
if not IMAGE_DIR.exists():
raise FileNotFoundError(f"Image folder not found: {IMAGE_DIR}")
annotations = load_annotations()
print(f"\nDevice: {DEVICE}")
if DEVICE == "cuda":
print(f"GPU: {torch.cuda.get_device_name(0)}")
print("Loading Grounding DINO...")
processor = AutoProcessor.from_pretrained(DINO_ID)
dino = AutoModelForZeroShotObjectDetection.from_pretrained(DINO_ID).to(DEVICE)
dino.eval()
print("Loading YOLO-World...")
yolo = YOLOWorld(str(YOLO_WEIGHTS) if YOLO_WEIGHTS.exists() else "yolov8s-world.pt")
all_predictions = {"Grounding DINO": {}, "YOLO-World": {}}
timing_rows = []
labels = CLASSES
for filename in CLASSES_BY_IMAGE:
image = Image.open(IMAGE_DIR / filename).convert("RGB")
print(f"\nEvaluating {filename}...")
dino_preds, dino_ms = run_dino(image, labels, processor, dino)
yolo_preds, yolo_ms = run_yolo(image, labels, yolo)
all_predictions["Grounding DINO"][filename] = dino_preds
all_predictions["YOLO-World"][filename] = yolo_preds
timing_rows.extend([
{"Image": filename, "Model": "Grounding DINO",
"Inference_Time_ms": round(dino_ms, 2),
"Predictions_at_0.25": sum(p["confidence"] >= EVAL_CONFIDENCE for p in dino_preds)},
{"Image": filename, "Model": "YOLO-World",
"Inference_Time_ms": round(yolo_ms, 2),
"Predictions_at_0.25": sum(p["confidence"] >= EVAL_CONFIDENCE for p in yolo_preds)}
])
print(f" Grounding DINO: {len(dino_preds)} raw predictions; {dino_ms:.1f} ms")
print(f" YOLO-World: {len(yolo_preds)} raw predictions; {yolo_ms:.1f} ms")
RESULTS_DIR.mkdir(parents=True, exist_ok=True)
# Preserve every raw prediction (including boxes and confidence) so results
# can be independently audited and re-evaluated without rerunning inference.
(RESULTS_DIR / "raw_predictions.json").write_text(
json.dumps(all_predictions, indent=2)
)
with (RESULTS_DIR / "inference_timings.csv").open("w", newline="") as f:
writer = csv.DictWriter(f, fieldnames=timing_rows[0].keys())
writer.writeheader()
writer.writerows(timing_rows)
summary_rows = []
ap_rows = []
for model_name, predictions in all_predictions.items():
for class_name in CLASSES:
base = evaluate_at_iou(predictions, annotations, class_name, 0.50)
summary_rows.append({
"Model": model_name, "Class": class_name,
"IoU_Threshold": 0.50,
**{k: round(v, 4) if isinstance(v, float) else v
for k, v in base.items() if k != "AP"}
})
for threshold in IOU_THRESHOLDS:
result = evaluate_at_iou(predictions, annotations, class_name, threshold)
ap_rows.append({
"Model": model_name, "Class": class_name,
"IoU_Threshold": threshold,
"AP": round(result["AP"], 4) if result["AP"] is not None else ""
})
with (RESULTS_DIR / "metrics_by_class.csv").open("w", newline="") as f:
writer = csv.DictWriter(f, fieldnames=summary_rows[0].keys())
writer.writeheader()
writer.writerows(summary_rows)
with (RESULTS_DIR / "average_precision.csv").open("w", newline="") as f:
writer = csv.DictWriter(f, fieldnames=ap_rows[0].keys())
writer.writeheader()
writer.writerows(ap_rows)
print("\nEVALUATION SUMMARY (confidence >= 0.25, IoU >= 0.50)")
print(f"{'Model':<18} {'Precision':>11} {'Recall':>9} {'F1':>9}")
for model_name in all_predictions:
rows = [r for r in summary_rows if r["Model"] == model_name]
tp = sum(r["TP"] for r in rows)
fp = sum(r["FP"] for r in rows)
fn = sum(r["FN"] for r in rows)
p = tp / (tp + fp) if tp + fp else 0.0
r = tp / (tp + fn) if tp + fn else 0.0
f1 = 2*p*r/(p+r) if p+r else 0.0
aps50 = [x["AP"] for x in ap_rows if x["Model"] == model_name and x["IoU_Threshold"] == 0.50 and x["AP"] != ""]
all_aps = [x["AP"] for x in ap_rows if x["Model"] == model_name and x["AP"] != ""]
map50 = float(np.mean(aps50)) if aps50 else 0.0
map5095 = float(np.mean(all_aps)) if all_aps else 0.0
print(f"{model_name:<18} {p:>11.4f} {r:>9.4f} {f1:>9.4f}")
print(f" mAP@50={map50:.4f} | mAP@50:95={map5095:.4f}")
print("\nFiles saved in:", RESULTS_DIR)
print(" ground_truth_annotations.json")
print(" inference_timings.csv")
print(" raw_predictions.json")
print(" metrics_by_class.csv")
print(" average_precision.csv")
print("\nImportant: results are for this small 8-image dataset only.")
if __name__ == "__main__":
main()
Binary file not shown.
+161
View File
@@ -0,0 +1,161 @@
Model,Class,IoU_Threshold,AP
Grounding DINO,caliper,0.5,0.0
Grounding DINO,caliper,0.55,0.0
Grounding DINO,caliper,0.6,0.0
Grounding DINO,caliper,0.65,0.0
Grounding DINO,caliper,0.7,0.0
Grounding DINO,caliper,0.75,0.0
Grounding DINO,caliper,0.8,0.0
Grounding DINO,caliper,0.85,0.0
Grounding DINO,caliper,0.9,0.0
Grounding DINO,caliper,0.95,0.0
Grounding DINO,laptop,0.5,1.0
Grounding DINO,laptop,0.55,1.0
Grounding DINO,laptop,0.6,1.0
Grounding DINO,laptop,0.65,1.0
Grounding DINO,laptop,0.7,0.0
Grounding DINO,laptop,0.75,0.0
Grounding DINO,laptop,0.8,0.0
Grounding DINO,laptop,0.85,0.0
Grounding DINO,laptop,0.9,0.0
Grounding DINO,laptop,0.95,0.0
Grounding DINO,mobile phone,0.5,1.0
Grounding DINO,mobile phone,0.55,1.0
Grounding DINO,mobile phone,0.6,0.0
Grounding DINO,mobile phone,0.65,0.0
Grounding DINO,mobile phone,0.7,0.0
Grounding DINO,mobile phone,0.75,0.0
Grounding DINO,mobile phone,0.8,0.0
Grounding DINO,mobile phone,0.85,0.0
Grounding DINO,mobile phone,0.9,0.0
Grounding DINO,mobile phone,0.95,0.0
Grounding DINO,person,0.5,1.0
Grounding DINO,person,0.55,1.0
Grounding DINO,person,0.6,1.0
Grounding DINO,person,0.65,1.0
Grounding DINO,person,0.7,1.0
Grounding DINO,person,0.75,1.0
Grounding DINO,person,0.8,1.0
Grounding DINO,person,0.85,1.0
Grounding DINO,person,0.9,0.0
Grounding DINO,person,0.95,0.0
Grounding DINO,pipe wrench,0.5,0.0
Grounding DINO,pipe wrench,0.55,0.0
Grounding DINO,pipe wrench,0.6,0.0
Grounding DINO,pipe wrench,0.65,0.0
Grounding DINO,pipe wrench,0.7,0.0
Grounding DINO,pipe wrench,0.75,0.0
Grounding DINO,pipe wrench,0.8,0.0
Grounding DINO,pipe wrench,0.85,0.0
Grounding DINO,pipe wrench,0.9,0.0
Grounding DINO,pipe wrench,0.95,0.0
Grounding DINO,safety helmet,0.5,0.2525
Grounding DINO,safety helmet,0.55,0.2525
Grounding DINO,safety helmet,0.6,0.2525
Grounding DINO,safety helmet,0.65,0.2525
Grounding DINO,safety helmet,0.7,0.2525
Grounding DINO,safety helmet,0.75,0.2525
Grounding DINO,safety helmet,0.8,0.2525
Grounding DINO,safety helmet,0.85,0.0
Grounding DINO,safety helmet,0.9,0.0
Grounding DINO,safety helmet,0.95,0.0
Grounding DINO,soldering iron,0.5,0.0
Grounding DINO,soldering iron,0.55,0.0
Grounding DINO,soldering iron,0.6,0.0
Grounding DINO,soldering iron,0.65,0.0
Grounding DINO,soldering iron,0.7,0.0
Grounding DINO,soldering iron,0.75,0.0
Grounding DINO,soldering iron,0.8,0.0
Grounding DINO,soldering iron,0.85,0.0
Grounding DINO,soldering iron,0.9,0.0
Grounding DINO,soldering iron,0.95,0.0
Grounding DINO,traffic cone,0.5,1.0
Grounding DINO,traffic cone,0.55,1.0
Grounding DINO,traffic cone,0.6,1.0
Grounding DINO,traffic cone,0.65,1.0
Grounding DINO,traffic cone,0.7,1.0
Grounding DINO,traffic cone,0.75,0.0
Grounding DINO,traffic cone,0.8,0.0
Grounding DINO,traffic cone,0.85,0.0
Grounding DINO,traffic cone,0.9,0.0
Grounding DINO,traffic cone,0.95,0.0
YOLO-World,caliper,0.5,0.0
YOLO-World,caliper,0.55,0.0
YOLO-World,caliper,0.6,0.0
YOLO-World,caliper,0.65,0.0
YOLO-World,caliper,0.7,0.0
YOLO-World,caliper,0.75,0.0
YOLO-World,caliper,0.8,0.0
YOLO-World,caliper,0.85,0.0
YOLO-World,caliper,0.9,0.0
YOLO-World,caliper,0.95,0.0
YOLO-World,laptop,0.5,1.0
YOLO-World,laptop,0.55,1.0
YOLO-World,laptop,0.6,1.0
YOLO-World,laptop,0.65,1.0
YOLO-World,laptop,0.7,0.0
YOLO-World,laptop,0.75,0.0
YOLO-World,laptop,0.8,0.0
YOLO-World,laptop,0.85,0.0
YOLO-World,laptop,0.9,0.0
YOLO-World,laptop,0.95,0.0
YOLO-World,mobile phone,0.5,1.0
YOLO-World,mobile phone,0.55,1.0
YOLO-World,mobile phone,0.6,0.0
YOLO-World,mobile phone,0.65,0.0
YOLO-World,mobile phone,0.7,0.0
YOLO-World,mobile phone,0.75,0.0
YOLO-World,mobile phone,0.8,0.0
YOLO-World,mobile phone,0.85,0.0
YOLO-World,mobile phone,0.9,0.0
YOLO-World,mobile phone,0.95,0.0
YOLO-World,person,0.5,1.0
YOLO-World,person,0.55,1.0
YOLO-World,person,0.6,1.0
YOLO-World,person,0.65,1.0
YOLO-World,person,0.7,1.0
YOLO-World,person,0.75,1.0
YOLO-World,person,0.8,1.0
YOLO-World,person,0.85,1.0
YOLO-World,person,0.9,0.0
YOLO-World,person,0.95,0.0
YOLO-World,pipe wrench,0.5,0.0
YOLO-World,pipe wrench,0.55,0.0
YOLO-World,pipe wrench,0.6,0.0
YOLO-World,pipe wrench,0.65,0.0
YOLO-World,pipe wrench,0.7,0.0
YOLO-World,pipe wrench,0.75,0.0
YOLO-World,pipe wrench,0.8,0.0
YOLO-World,pipe wrench,0.85,0.0
YOLO-World,pipe wrench,0.9,0.0
YOLO-World,pipe wrench,0.95,0.0
YOLO-World,safety helmet,0.5,0.0
YOLO-World,safety helmet,0.55,0.0
YOLO-World,safety helmet,0.6,0.0
YOLO-World,safety helmet,0.65,0.0
YOLO-World,safety helmet,0.7,0.0
YOLO-World,safety helmet,0.75,0.0
YOLO-World,safety helmet,0.8,0.0
YOLO-World,safety helmet,0.85,0.0
YOLO-World,safety helmet,0.9,0.0
YOLO-World,safety helmet,0.95,0.0
YOLO-World,soldering iron,0.5,0.0
YOLO-World,soldering iron,0.55,0.0
YOLO-World,soldering iron,0.6,0.0
YOLO-World,soldering iron,0.65,0.0
YOLO-World,soldering iron,0.7,0.0
YOLO-World,soldering iron,0.75,0.0
YOLO-World,soldering iron,0.8,0.0
YOLO-World,soldering iron,0.85,0.0
YOLO-World,soldering iron,0.9,0.0
YOLO-World,soldering iron,0.95,0.0
YOLO-World,traffic cone,0.5,1.0
YOLO-World,traffic cone,0.55,1.0
YOLO-World,traffic cone,0.6,1.0
YOLO-World,traffic cone,0.65,1.0
YOLO-World,traffic cone,0.7,1.0
YOLO-World,traffic cone,0.75,0.0
YOLO-World,traffic cone,0.8,0.0
YOLO-World,traffic cone,0.85,0.0
YOLO-World,traffic cone,0.9,0.0
YOLO-World,traffic cone,0.95,0.0
1 Model Class IoU_Threshold AP
2 Grounding DINO caliper 0.5 0.0
3 Grounding DINO caliper 0.55 0.0
4 Grounding DINO caliper 0.6 0.0
5 Grounding DINO caliper 0.65 0.0
6 Grounding DINO caliper 0.7 0.0
7 Grounding DINO caliper 0.75 0.0
8 Grounding DINO caliper 0.8 0.0
9 Grounding DINO caliper 0.85 0.0
10 Grounding DINO caliper 0.9 0.0
11 Grounding DINO caliper 0.95 0.0
12 Grounding DINO laptop 0.5 1.0
13 Grounding DINO laptop 0.55 1.0
14 Grounding DINO laptop 0.6 1.0
15 Grounding DINO laptop 0.65 1.0
16 Grounding DINO laptop 0.7 0.0
17 Grounding DINO laptop 0.75 0.0
18 Grounding DINO laptop 0.8 0.0
19 Grounding DINO laptop 0.85 0.0
20 Grounding DINO laptop 0.9 0.0
21 Grounding DINO laptop 0.95 0.0
22 Grounding DINO mobile phone 0.5 1.0
23 Grounding DINO mobile phone 0.55 1.0
24 Grounding DINO mobile phone 0.6 0.0
25 Grounding DINO mobile phone 0.65 0.0
26 Grounding DINO mobile phone 0.7 0.0
27 Grounding DINO mobile phone 0.75 0.0
28 Grounding DINO mobile phone 0.8 0.0
29 Grounding DINO mobile phone 0.85 0.0
30 Grounding DINO mobile phone 0.9 0.0
31 Grounding DINO mobile phone 0.95 0.0
32 Grounding DINO person 0.5 1.0
33 Grounding DINO person 0.55 1.0
34 Grounding DINO person 0.6 1.0
35 Grounding DINO person 0.65 1.0
36 Grounding DINO person 0.7 1.0
37 Grounding DINO person 0.75 1.0
38 Grounding DINO person 0.8 1.0
39 Grounding DINO person 0.85 1.0
40 Grounding DINO person 0.9 0.0
41 Grounding DINO person 0.95 0.0
42 Grounding DINO pipe wrench 0.5 0.0
43 Grounding DINO pipe wrench 0.55 0.0
44 Grounding DINO pipe wrench 0.6 0.0
45 Grounding DINO pipe wrench 0.65 0.0
46 Grounding DINO pipe wrench 0.7 0.0
47 Grounding DINO pipe wrench 0.75 0.0
48 Grounding DINO pipe wrench 0.8 0.0
49 Grounding DINO pipe wrench 0.85 0.0
50 Grounding DINO pipe wrench 0.9 0.0
51 Grounding DINO pipe wrench 0.95 0.0
52 Grounding DINO safety helmet 0.5 0.2525
53 Grounding DINO safety helmet 0.55 0.2525
54 Grounding DINO safety helmet 0.6 0.2525
55 Grounding DINO safety helmet 0.65 0.2525
56 Grounding DINO safety helmet 0.7 0.2525
57 Grounding DINO safety helmet 0.75 0.2525
58 Grounding DINO safety helmet 0.8 0.2525
59 Grounding DINO safety helmet 0.85 0.0
60 Grounding DINO safety helmet 0.9 0.0
61 Grounding DINO safety helmet 0.95 0.0
62 Grounding DINO soldering iron 0.5 0.0
63 Grounding DINO soldering iron 0.55 0.0
64 Grounding DINO soldering iron 0.6 0.0
65 Grounding DINO soldering iron 0.65 0.0
66 Grounding DINO soldering iron 0.7 0.0
67 Grounding DINO soldering iron 0.75 0.0
68 Grounding DINO soldering iron 0.8 0.0
69 Grounding DINO soldering iron 0.85 0.0
70 Grounding DINO soldering iron 0.9 0.0
71 Grounding DINO soldering iron 0.95 0.0
72 Grounding DINO traffic cone 0.5 1.0
73 Grounding DINO traffic cone 0.55 1.0
74 Grounding DINO traffic cone 0.6 1.0
75 Grounding DINO traffic cone 0.65 1.0
76 Grounding DINO traffic cone 0.7 1.0
77 Grounding DINO traffic cone 0.75 0.0
78 Grounding DINO traffic cone 0.8 0.0
79 Grounding DINO traffic cone 0.85 0.0
80 Grounding DINO traffic cone 0.9 0.0
81 Grounding DINO traffic cone 0.95 0.0
82 YOLO-World caliper 0.5 0.0
83 YOLO-World caliper 0.55 0.0
84 YOLO-World caliper 0.6 0.0
85 YOLO-World caliper 0.65 0.0
86 YOLO-World caliper 0.7 0.0
87 YOLO-World caliper 0.75 0.0
88 YOLO-World caliper 0.8 0.0
89 YOLO-World caliper 0.85 0.0
90 YOLO-World caliper 0.9 0.0
91 YOLO-World caliper 0.95 0.0
92 YOLO-World laptop 0.5 1.0
93 YOLO-World laptop 0.55 1.0
94 YOLO-World laptop 0.6 1.0
95 YOLO-World laptop 0.65 1.0
96 YOLO-World laptop 0.7 0.0
97 YOLO-World laptop 0.75 0.0
98 YOLO-World laptop 0.8 0.0
99 YOLO-World laptop 0.85 0.0
100 YOLO-World laptop 0.9 0.0
101 YOLO-World laptop 0.95 0.0
102 YOLO-World mobile phone 0.5 1.0
103 YOLO-World mobile phone 0.55 1.0
104 YOLO-World mobile phone 0.6 0.0
105 YOLO-World mobile phone 0.65 0.0
106 YOLO-World mobile phone 0.7 0.0
107 YOLO-World mobile phone 0.75 0.0
108 YOLO-World mobile phone 0.8 0.0
109 YOLO-World mobile phone 0.85 0.0
110 YOLO-World mobile phone 0.9 0.0
111 YOLO-World mobile phone 0.95 0.0
112 YOLO-World person 0.5 1.0
113 YOLO-World person 0.55 1.0
114 YOLO-World person 0.6 1.0
115 YOLO-World person 0.65 1.0
116 YOLO-World person 0.7 1.0
117 YOLO-World person 0.75 1.0
118 YOLO-World person 0.8 1.0
119 YOLO-World person 0.85 1.0
120 YOLO-World person 0.9 0.0
121 YOLO-World person 0.95 0.0
122 YOLO-World pipe wrench 0.5 0.0
123 YOLO-World pipe wrench 0.55 0.0
124 YOLO-World pipe wrench 0.6 0.0
125 YOLO-World pipe wrench 0.65 0.0
126 YOLO-World pipe wrench 0.7 0.0
127 YOLO-World pipe wrench 0.75 0.0
128 YOLO-World pipe wrench 0.8 0.0
129 YOLO-World pipe wrench 0.85 0.0
130 YOLO-World pipe wrench 0.9 0.0
131 YOLO-World pipe wrench 0.95 0.0
132 YOLO-World safety helmet 0.5 0.0
133 YOLO-World safety helmet 0.55 0.0
134 YOLO-World safety helmet 0.6 0.0
135 YOLO-World safety helmet 0.65 0.0
136 YOLO-World safety helmet 0.7 0.0
137 YOLO-World safety helmet 0.75 0.0
138 YOLO-World safety helmet 0.8 0.0
139 YOLO-World safety helmet 0.85 0.0
140 YOLO-World safety helmet 0.9 0.0
141 YOLO-World safety helmet 0.95 0.0
142 YOLO-World soldering iron 0.5 0.0
143 YOLO-World soldering iron 0.55 0.0
144 YOLO-World soldering iron 0.6 0.0
145 YOLO-World soldering iron 0.65 0.0
146 YOLO-World soldering iron 0.7 0.0
147 YOLO-World soldering iron 0.75 0.0
148 YOLO-World soldering iron 0.8 0.0
149 YOLO-World soldering iron 0.85 0.0
150 YOLO-World soldering iron 0.9 0.0
151 YOLO-World soldering iron 0.95 0.0
152 YOLO-World traffic cone 0.5 1.0
153 YOLO-World traffic cone 0.55 1.0
154 YOLO-World traffic cone 0.6 1.0
155 YOLO-World traffic cone 0.65 1.0
156 YOLO-World traffic cone 0.7 1.0
157 YOLO-World traffic cone 0.75 0.0
158 YOLO-World traffic cone 0.8 0.0
159 YOLO-World traffic cone 0.85 0.0
160 YOLO-World traffic cone 0.9 0.0
161 YOLO-World traffic cone 0.95 0.0
+17
View File
@@ -0,0 +1,17 @@
Image,Model,Inference_Time_ms,Predictions_at_0.25
sample_1.png,Grounding DINO,672.13,4
sample_1.png,YOLO-World,114.76,2
sample_2.png,Grounding DINO,357.13,3
sample_2.png,YOLO-World,96.0,0
sample_3.png,Grounding DINO,358.56,2
sample_3.png,YOLO-World,70.42,2
sample_4.png,Grounding DINO,346.23,5
sample_4.png,YOLO-World,109.14,1
sample_5.png,Grounding DINO,359.38,2
sample_5.png,YOLO-World,72.02,2
sample_6.png,Grounding DINO,366.9,4
sample_6.png,YOLO-World,69.72,0
sample_7.png,Grounding DINO,357.22,1
sample_7.png,YOLO-World,71.54,0
sample_8.png,Grounding DINO,373.23,7
sample_8.png,YOLO-World,70.28,0
1 Image Model Inference_Time_ms Predictions_at_0.25
2 sample_1.png Grounding DINO 672.13 4
3 sample_1.png YOLO-World 114.76 2
4 sample_2.png Grounding DINO 357.13 3
5 sample_2.png YOLO-World 96.0 0
6 sample_3.png Grounding DINO 358.56 2
7 sample_3.png YOLO-World 70.42 2
8 sample_4.png Grounding DINO 346.23 5
9 sample_4.png YOLO-World 109.14 1
10 sample_5.png Grounding DINO 359.38 2
11 sample_5.png YOLO-World 72.02 2
12 sample_6.png Grounding DINO 366.9 4
13 sample_6.png YOLO-World 69.72 0
14 sample_7.png Grounding DINO 357.22 1
15 sample_7.png YOLO-World 71.54 0
16 sample_8.png Grounding DINO 373.23 7
17 sample_8.png YOLO-World 70.28 0
+17
View File
@@ -0,0 +1,17 @@
Model,Class,IoU_Threshold,TP,FP,FN,Precision,Recall,F1
Grounding DINO,caliper,0.5,0,5,1,0.0,0.0,0.0
Grounding DINO,laptop,0.5,1,0,0,1.0,1.0,1.0
Grounding DINO,mobile phone,0.5,1,4,0,0.2,1.0,0.3333
Grounding DINO,person,0.5,1,6,0,0.1429,1.0,0.25
Grounding DINO,pipe wrench,0.5,0,0,1,0.0,0.0,0.0
Grounding DINO,safety helmet,0.5,1,1,1,0.5,0.5,0.5
Grounding DINO,soldering iron,0.5,0,1,1,0.0,0.0,0.0
Grounding DINO,traffic cone,0.5,1,0,0,1.0,1.0,1.0
YOLO-World,caliper,0.5,0,0,1,0.0,0.0,0.0
YOLO-World,laptop,0.5,1,0,0,1.0,1.0,1.0
YOLO-World,mobile phone,0.5,1,0,0,1.0,1.0,1.0
YOLO-World,person,0.5,1,2,0,0.3333,1.0,0.5
YOLO-World,pipe wrench,0.5,0,0,1,0.0,0.0,0.0
YOLO-World,safety helmet,0.5,0,1,2,0.0,0.0,0.0
YOLO-World,soldering iron,0.5,0,0,1,0.0,0.0,0.0
YOLO-World,traffic cone,0.5,1,0,0,1.0,1.0,1.0
1 Model Class IoU_Threshold TP FP FN Precision Recall F1
2 Grounding DINO caliper 0.5 0 5 1 0.0 0.0 0.0
3 Grounding DINO laptop 0.5 1 0 0 1.0 1.0 1.0
4 Grounding DINO mobile phone 0.5 1 4 0 0.2 1.0 0.3333
5 Grounding DINO person 0.5 1 6 0 0.1429 1.0 0.25
6 Grounding DINO pipe wrench 0.5 0 0 1 0.0 0.0 0.0
7 Grounding DINO safety helmet 0.5 1 1 1 0.5 0.5 0.5
8 Grounding DINO soldering iron 0.5 0 1 1 0.0 0.0 0.0
9 Grounding DINO traffic cone 0.5 1 0 0 1.0 1.0 1.0
10 YOLO-World caliper 0.5 0 0 1 0.0 0.0 0.0
11 YOLO-World laptop 0.5 1 0 0 1.0 1.0 1.0
12 YOLO-World mobile phone 0.5 1 0 0 1.0 1.0 1.0
13 YOLO-World person 0.5 1 2 0 0.3333 1.0 0.5
14 YOLO-World pipe wrench 0.5 0 0 1 0.0 0.0 0.0
15 YOLO-World safety helmet 0.5 0 1 2 0.0 0.0 0.0
16 YOLO-World soldering iron 0.5 0 0 1 0.0 0.0 0.0
17 YOLO-World traffic cone 0.5 1 0 0 1.0 1.0 1.0
File diff suppressed because it is too large Load Diff
+131
View File
@@ -0,0 +1,131 @@
{
"sample_1.png": {
"width": 162,
"height": 182,
"objects": [
{
"class": "person",
"bbox_xyxy": [
47,
8,
116,
177
]
},
{
"class": "safety helmet",
"bbox_xyxy": [
79,
13,
101,
36
]
}
]
},
"sample_2.png": {
"width": 171,
"height": 182,
"objects": [
{
"class": "safety helmet",
"bbox_xyxy": [
10,
9,
161,
147
]
}
]
},
"sample_3.png": {
"width": 171,
"height": 185,
"objects": [
{
"class": "mobile phone",
"bbox_xyxy": [
42,
7,
146,
174
]
}
]
},
"sample_4.png": {
"width": 175,
"height": 183,
"objects": [
{
"class": "laptop",
"bbox_xyxy": [
2,
19,
174,
169
]
}
]
},
"sample_5.png": {
"width": 167,
"height": 181,
"objects": [
{
"class": "traffic cone",
"bbox_xyxy": [
36,
26,
132,
179
]
}
]
},
"sample_6.png": {
"width": 166,
"height": 184,
"objects": [
{
"class": "caliper",
"bbox_xyxy": [
22,
33,
164,
153
]
}
]
},
"sample_7.png": {
"width": 167,
"height": 181,
"objects": [
{
"class": "pipe wrench",
"bbox_xyxy": [
2,
49,
166,
164
]
}
]
},
"sample_8.png": {
"width": 161,
"height": 181,
"objects": [
{
"class": "soldering iron",
"bbox_xyxy": [
52,
0,
160,
124
]
}
]
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB