diff --git a/project/class_object_analysis.py b/project/class_object_analysis.py index a3931d3..db30054 100644 --- a/project/class_object_analysis.py +++ b/project/class_object_analysis.py @@ -10,101 +10,198 @@ matplotlib.use("Agg") # safe for headless / servers import matplotlib.pyplot as plt +# ====================== COCO -> Super mapping ====================== + +COCO_TO_SUPER = { + 'person': 'person', + + 'bicycle': 'vehicle', 'car': 'vehicle', 'motorcycle': 'vehicle', 'airplane': 'vehicle', + 'bus': 'vehicle', 'train': 'vehicle', 'truck': 'vehicle', 'boat': 'vehicle', 'traffic light': 'outdoor', + + 'fire hydrant': 'outdoor', 'stop sign': 'outdoor', 'parking meter': 'outdoor', 'bench': 'outdoor', + + 'bird': 'animal', 'cat': 'animal', 'dog': 'animal', 'horse': 'animal', 'sheep': 'animal', + 'cow': 'animal', 'elephant': 'animal', 'bear': 'animal', 'zebra': 'animal', 'giraffe': 'animal', + + 'backpack': 'accessory', 'umbrella': 'accessory', 'handbag': 'accessory', 'tie': 'accessory', + 'suitcase': 'accessory', + + 'frisbee': 'sports', 'skis': 'sports', 'snowboard': 'sports', 'sports ball': 'sports', 'kite': 'sports', + 'baseball bat': 'sports', 'baseball glove': 'sports', 'skateboard': 'sports', 'surfboard': 'sports', + 'tennis racket': 'sports', + + 'bottle': 'kitchen', 'wine glass': 'kitchen', 'cup': 'kitchen', 'fork': 'kitchen', 'knife': 'kitchen', + 'spoon': 'kitchen', 'bowl': 'kitchen', + + 'banana': 'food', 'apple': 'food', 'sandwich': 'food', 'orange': 'food', 'broccoli': 'food', + 'carrot': 'food', 'hot dog': 'food', 'pizza': 'food', 'donut': 'food', 'cake': 'food', + + 'chair': 'furniture', 'couch': 'furniture', 'potted plant': 'furniture', 'bed': 'furniture', + 'dining table': 'furniture', 'toilet': 'furniture', + + 'tv': 'electronic', 'laptop': 'electronic', 'mouse': 'electronic', 'remote': 'electronic', + 'keyboard': 'electronic', 'cell phone': 'electronic', + + 'microwave': 'appliance', 'oven': 'appliance', 'toaster': 'appliance', 'sink': 'appliance', + 'refrigerator': 'appliance', + + 'book': 'indoor', 'clock': 'indoor', 'vase': 'indoor', 'scissors': 'indoor', 'teddy bear': 'indoor', + 'hair drier': 'indoor', 'toothbrush': 'indoor' +} + + # ====================== Aggregation / Sorting ====================== -def _aggregate_class_stats(results: dict): +def _aggregate_label_stats(results: dict): """ - Aggregate per-class GT totals and matches across all techniques. - Returns (totals, matches) dicts keyed by class string. + Aggregate GT totals and matches across all techniques for the current label space + (label = class or super, depending on prior regrouping). """ totals = defaultdict(int) matches = defaultdict(int) for tech_metrics in results.values(): - for cls, stats in tech_metrics.get("per_class", {}).items(): - totals[cls] += int(stats.get("gt_objects", 0)) - matches[cls] += int(stats.get("matched", 0)) + for label, stats in tech_metrics.get("per_class", {}).items(): + totals[label] += int(stats.get("gt_objects", 0)) + matches[label] += int(stats.get("matched", 0)) return totals, matches def _class_order(results: dict, mode: str = "accuracy", min_instances: int = 10, face_overlap_stats: dict | None = None): """ - Returns a list of class names ordered by: + Returns a list of label names ordered by: - "accuracy": overall matched/gt desc (NaN last), then alpha - "prevalence": overall gt desc, then alpha - "alpha": alphabetical - "face_iou": average IoU with face (desc), then alpha - Only classes with totals >= min_instances are included. + Only labels with totals >= min_instances are included. + NOTE: 'results' should already be in the desired label space (class or super). """ - totals, matches = _aggregate_class_stats(results) - classes = [c for c in totals.keys() if totals[c] >= min_instances] + totals, matches = _aggregate_label_stats(results) + labels = [c for c in totals.keys() if totals[c] >= min_instances] if mode == "prevalence": - classes.sort(key=lambda c: (-totals[c], c)) - return classes + labels.sort(key=lambda c: (-totals[c], c)) + return labels if mode == "alpha": - classes.sort() - return classes + labels.sort() + return labels if mode == "face_iou": def avg_iou(c): if not face_overlap_stats or c not in face_overlap_stats: return float("nan") return face_overlap_stats[c].get("avg_iou", float("nan")) - classes.sort( + labels.sort( key=lambda c: (np.isnan(avg_iou(c)), -(avg_iou(c) if not np.isnan(avg_iou(c)) else -1.0), c) ) - return classes + return labels # default: accuracy acc = { c: (matches[c] / totals[c]) if totals[c] > 0 else float("nan") - for c in classes + for c in labels } - classes.sort( + labels.sort( key=lambda c: ( np.isnan(acc[c]), # NaNs last -(acc[c] if not np.isnan(acc[c]) else -1.0), # desc acc c # tie-break alpha ) ) - return classes + return labels -# ====================== Visualization ====================== +# ====================== Regrouping helpers (class -> super) ====================== -def _face_filter_label(face_filter: str) -> str: +def _to_group(label: str, group_by: str) -> str: + if group_by == "super": + return COCO_TO_SUPER.get(label, label) # fallback to label if missing + return label + +def _regroup_results_to(results: dict, group_by: str) -> dict: + """ + Convert technique->{'overall', 'per_class'} to desired label space: + - if group_by == 'class', return results as is. + - if group_by == 'super', aggregate per_class into super-categories. + """ + if group_by != "super": + return results + + regrouped = {} + for tech, metrics in results.items(): + agg = defaultdict(lambda: {"gt_objects": 0, "matched": 0, "detection_accuracy": 0.0}) + for cls, stats in metrics.get("per_class", {}).items(): + g = _to_group(cls, "super") + agg[g]["gt_objects"] += int(stats.get("gt_objects", 0)) + agg[g]["matched"] += int(stats.get("matched", 0)) + # recompute acc + for g, s in agg.items(): + tot = s["gt_objects"]; mat = s["matched"] + s["detection_accuracy"] = (mat / tot) if tot > 0 else 0.0 + + regrouped[tech] = { + "overall": dict(metrics.get("overall", {})), # unchanged + "per_class": dict(agg) + } + return regrouped + +def _regroup_face_stats_to(face_stats: dict, group_by: str) -> dict: + """ + Convert {class: {count,sum_iou,avg_iou}} to desired label space. + If group_by == 'super', sum counts & sums by super and recompute avg. + """ + if group_by != "super": + return face_stats + + counts = defaultdict(int) + sums = defaultdict(float) + for cls, d in face_stats.items(): + g = _to_group(cls, "super") + counts[g] += int(d.get("count", 0)) + sums[g] += float(d.get("sum_iou", 0.0)) + out = {} + for g in counts.keys(): + n = counts[g]; s = sums[g] + out[g] = {"count": n, "sum_iou": s, "avg_iou": (s / n) if n > 0 else float("nan")} + return out + + +# ====================== Visualization helpers ====================== + +def _face_filter_label(face_mode: str) -> str: return { - "overlap": "filter=overlap", - "nonoverlap": "filter=nonoverlap", - "any": "filter=any", - }.get(face_filter, f"filter={face_filter}") + "overlap": "overlap", + "nonoverlap": "nonoverlap", + "any": "any", + "delta": "Δ(overlap−nonoverlap)", + }.get(face_mode, face_mode) +# ====================== Base (non-delta) plots ====================== + def save_confusion_style_matrix(results: dict, out_path: str, - title: str = "Technique × Class (matched/GT; %)", + title: str = "Technique × Label (matched/GT; %)", class_sort: str = "accuracy", min_instances: int = 10, face_overlap_stats: dict | None = None, - face_filter: str = "overlap"): + face_mode: str = "overlap", + x_label_name: str = "Class"): """ - Builds a Technique x Class matrix from `results['per_class']`. - Only classes with >= min_instances GT are included. - Cell text shows "matched/GT" and "acc%". - Includes Σ row/column with totals; missing cells are light gray. + Builds a Technique x Label matrix from results['per_class'] (label = class or super). """ techniques = sorted(results.keys()) - classes = _class_order(results, class_sort, min_instances, face_overlap_stats) - if not techniques or not classes: - raise ValueError("No techniques or classes found to plot (check filters).") + labels = _class_order(results, class_sort, min_instances, face_overlap_stats) + if not techniques or not labels: + raise ValueError("No techniques or labels found to plot (check filters).") - n_t, n_c = len(techniques), len(classes) + n_t, n_c = len(techniques), len(labels) matched = np.zeros((n_t, n_c), dtype=int) total = np.zeros((n_t, n_c), dtype=int) for i, tech in enumerate(techniques): per = results[tech].get("per_class", {}) - for j, cls in enumerate(classes): - d = per.get(cls) + for j, lab in enumerate(labels): + d = per.get(lab) if d: matched[i, j] = int(d.get("matched", 0)) total[i, j] = int(d.get("gt_objects", 0)) @@ -141,11 +238,11 @@ def save_confusion_style_matrix(results: dict, out_path: str, total_ext[n_t, n_c] = all_total acc_ext[n_t, n_c] = (all_matched / all_total * 100.0) if all_total > 0 else np.nan - classes_ext = classes + ["Σ classes"] + labels_ext = labels + ["Σ labels"] techniques_ext = techniques + ["Σ techniques"] # Plot - fig_w = max(10, 0.6 * len(classes_ext) + 2) + fig_w = max(10, 0.6 * len(labels_ext) + 2) fig_h = max(5, 0.6 * len(techniques_ext) + 1) fig, ax = plt.subplots(figsize=(fig_w, fig_h)) @@ -153,21 +250,22 @@ def save_confusion_style_matrix(results: dict, out_path: str, cmap.set_bad("#eeeeee") im = ax.imshow(np.ma.masked_invalid(acc_ext), cmap=cmap, vmin=0, vmax=100, aspect="auto") - ax.set_xticks(np.arange(len(classes_ext))) + ax.set_xticks(np.arange(len(labels_ext))) ax.set_yticks(np.arange(len(techniques_ext))) + # Optionally append avg face IoU to column labels when sorting by face_iou if class_sort == "face_iou" and face_overlap_stats: def label_with_iou(c): info = face_overlap_stats.get(c, {}) avg = info.get("avg_iou", float("nan")) return f"{c}\n(μ IoU={avg:.2f})" if not np.isnan(avg) else c - core_labels = [label_with_iou(c) for c in classes] + core_labels = [label_with_iou(c) for c in labels] else: - core_labels = classes + core_labels = labels - ax.set_xticklabels(core_labels + ["Σ classes"], rotation=45, ha="right") + ax.set_xticklabels(core_labels + ["Σ labels"], rotation=45, ha="right") ax.set_yticklabels(techniques_ext) - ax.set_xlabel(f"MSCOCO Class ({_face_filter_label(face_filter)}, ≥{min_instances} GT)") + ax.set_xlabel(f"MSCOCO {x_label_name} ({_face_filter_label(face_mode)}, ≥{min_instances} GT)") ax.set_ylabel("Technique") ax.set_title(title, pad=12) @@ -189,64 +287,243 @@ def save_confusion_style_matrix(results: dict, out_path: str, def save_heatmap(results: dict, out_path: str, - title: str = "Detection accuracy by technique and class", + title: str = "Detection accuracy by technique and label", class_sort: str = "accuracy", min_instances: int = 10, face_overlap_stats: dict | None = None, - face_filter: str = "overlap"): + face_mode: str = "overlap", + x_label_name: str = "Class"): """ - Technique x Class heatmap from `results['per_class']`. Values are percentages. - Only classes with >= min_instances GT are included. + Technique x Label heatmap from `results['per_class']` (label = class or super). """ techniques = sorted(results.keys()) - classes = _class_order(results, class_sort, min_instances, face_overlap_stats) - if not techniques or not classes: - raise ValueError("No techniques or classes found to plot (check filters).") + labels = _class_order(results, class_sort, min_instances, face_overlap_stats) + if not techniques or not labels: + raise ValueError("No techniques or labels found to plot (check filters).") - M = np.full((len(techniques), len(classes)), np.nan, dtype=float) + M = np.full((len(techniques), len(labels)), np.nan, dtype=float) for i, tech in enumerate(techniques): per = results[tech].get("per_class", {}) - for j, cls in enumerate(classes): - acc = per.get(cls, {}).get("detection_accuracy", None) + for j, lab in enumerate(labels): + acc = per.get(lab, {}).get("detection_accuracy", None) if acc is not None: M[i, j] = acc * 100.0 M_masked = np.ma.masked_invalid(M) - fig_w = max(10, 0.6 * len(classes) + 2) - fig_h = max(5, 0.6 * len(techniques) + 1) + fig_w = 10#max(10, 0.6 * len(labels) + 2) + fig_h = 3#max(5, 0.6 * len(techniques) + 1) fig, ax = plt.subplots(figsize=(fig_w, fig_h)) cmap = plt.cm.viridis.copy() cmap.set_bad("#eeeeee") im = ax.imshow(M_masked, cmap=cmap, aspect="auto", vmin=0, vmax=100) - ax.set_xticks(np.arange(len(classes))) + ax.set_xticks(np.arange(len(labels))) if class_sort == "face_iou" and face_overlap_stats: def label_with_iou(c): info = face_overlap_stats.get(c, {}) avg = info.get("avg_iou", float("nan")) return f"{c}\n(μ IoU={avg:.2f})" if not np.isnan(avg) else c - xticklabels = [label_with_iou(c) for c in classes] + xticklabels = [label_with_iou(c) for c in labels] else: - xticklabels = classes - ax.set_xticklabels(xticklabels, rotation=45, ha="right") + xticklabels = labels + ax.set_xticklabels(xticklabels, rotation=45, ha="right", fontsize=12) ax.set_yticks(np.arange(len(techniques))) - ax.set_yticklabels(techniques) - ax.set_xlabel(f"MSCOCO Class ({_face_filter_label(face_filter)}, ≥{min_instances} GT)") - ax.set_ylabel("Technique") - ax.set_title(title, pad=12) + ax.set_yticklabels(techniques, fontsize=12) + #ax.set_xlabel(f"MSCOCO {x_label_name} ({_face_filter_label(face_mode)}, ≥{min_instances} GT)") + #ax.set_ylabel("Technique") + #ax.set_title(title, pad=12) # Annotate % for i in range(M.shape[0]): for j in range(M.shape[1]): val = M[i, j] if not np.isnan(val): - ax.text(j, i, f"{val:.1f}%", ha="center", va="center", fontsize=8) + ax.text(j, i, f"{val:.0f}%", ha="center", va="center", fontsize=12) + + cbar = fig.colorbar(im, ax=ax, fraction=0.046, pad=0.03) + #cbar.set_label("Detection accuracy (%)", rotation=90, labelpad=10) + + fig.tight_layout() + os.makedirs(os.path.dirname(out_path), exist_ok=True) + fig.savefig(out_path, dpi=200, bbox_inches="tight") + plt.close(fig) + + +# ====================== Δ (delta) plots ====================== + +def _merge_results_across_subsets(res_a: dict, res_b: dict) -> dict: + """ + Merge two results dicts (same shape as usual technique->metrics) by SUMMING counts. + Useful in delta mode to build filtering/ordering totals from both overlap and nonoverlap. + """ + merged = {} + for res in (res_a, res_b): + for tech, metrics in res.items(): + tgt = merged.setdefault(tech, {"overall": {"gt_objects": 0, "matched": 0, "detection_accuracy": 0.0}, + "per_class": {}}) + tgt["overall"]["gt_objects"] += int(metrics["overall"].get("gt_objects", 0)) + tgt["overall"]["matched"] += int(metrics["overall"].get("matched", 0)) + for lbl, stats in metrics.get("per_class", {}).items(): + pc = tgt["per_class"].setdefault(lbl, {"gt_objects": 0, "matched": 0, "detection_accuracy": 0.0}) + pc["gt_objects"] += int(stats.get("gt_objects", 0)) + pc["matched"] += int(stats.get("matched", 0)) + # recompute acc + for tech, metrics in merged.items(): + tot = metrics["overall"]["gt_objects"] + mat = metrics["overall"]["matched"] + metrics["overall"]["detection_accuracy"] = (mat / tot) if tot > 0 else 0.0 + for lbl, stats in metrics["per_class"].items(): + ct = stats["gt_objects"]; cm = stats["matched"] + stats["detection_accuracy"] = (cm / ct) if ct > 0 else 0.0 + return merged + + +def _delta_matrix(overlap_results: dict, nonoverlap_results: dict, techniques: list[str], labels: list[str]) -> np.ndarray: + """ + Build a (tech x label) matrix of Δ accuracy (pp) = (overlap - nonoverlap)*100. + Missing cells become NaN. + """ + D = np.full((len(techniques), len(labels)), np.nan, dtype=float) + for i, tech in enumerate(techniques): + per_o = overlap_results.get(tech, {}).get("per_class", {}) + per_n = nonoverlap_results.get(tech, {}).get("per_class", {}) + for j, lab in enumerate(labels): + ao = per_o.get(lab, {}).get("detection_accuracy", None) + an = per_n.get(lab, {}).get("detection_accuracy", None) + if ao is None or an is None: + D[i, j] = np.nan + else: + D[i, j] = (ao - an) * 100.0 + return D + + +def save_heatmap_delta(overlap_results: dict, nonoverlap_results: dict, out_path: str, + title: str = "Δ accuracy (overlap − nonoverlap) by technique and label", + class_sort: str = "accuracy", min_instances: int = 10, + face_overlap_stats: dict | None = None, # use overlap stats for face_iou sorting + x_label_name: str = "Class"): + """ + Diverging heatmap showing Δ accuracy in percentage points. + """ + # Build ordering/filter totals from combined results + combined_for_order = _merge_results_across_subsets(overlap_results, nonoverlap_results) + techniques = sorted(set(overlap_results.keys()) | set(nonoverlap_results.keys())) + labels = _class_order(combined_for_order, class_sort, min_instances, face_overlap_stats) + if not techniques or not labels: + raise ValueError("No techniques or labels found to plot (check filters).") + + D = _delta_matrix(overlap_results, nonoverlap_results, techniques, labels) + D_masked = np.ma.masked_invalid(D) + + vmax = np.nanmax(np.abs(D)) if np.isfinite(np.nanmax(np.abs(D))) else 1.0 + print(vmax) + if vmax == 0: + vmax = 1.0 + + fig_w = max(10, 0.6 * len(labels) + 2) + fig_h = max(5, 0.6 * len(techniques) + 1) + fig, ax = plt.subplots(figsize=(fig_w, fig_h)) + + cmap = plt.cm.viridis.copy() #plt.cm.RdBu_r + #cmap = cmap.copy() + cmap.set_bad("#eeeeee") + im = ax.imshow(D_masked, cmap=cmap, aspect="auto", vmin=-vmax, vmax=0) + + ax.set_xticks(np.arange(len(labels))) + ax.set_yticks(np.arange(len(techniques))) + + # If sorting by face_iou, append μ IoU from overlap stats + if face_overlap_stats and class_sort == "face_iou": + def label_with_iou(c): + info = face_overlap_stats.get(c, {}) + avg = info.get("avg_iou", float("nan")) + return f"{c}\n(μ IoU={avg:.2f})" if not np.isnan(avg) else c + xticklabels = [label_with_iou(c) for c in labels] + else: + xticklabels = labels + + ax.set_xticklabels(xticklabels, rotation=45, ha="right") + ax.set_yticklabels(techniques) + #ax.set_xlabel(f"MSCOCO {x_label_name} (Δ overlap−nonoverlap; ≥{min_instances} GT total)") + #ax.set_ylabel("Technique") + #ax.set_title(title, pad=12) + + # Annotate Δ pp + for i in range(D.shape[0]): + for j in range(D.shape[1]): + val = D[i, j] + if not np.isnan(val): + ax.text(j, i, f"{val:+.0f}", ha="center", va="center", fontsize=8) cbar = fig.colorbar(im, ax=ax, fraction=0.046, pad=0.04) - cbar.set_label("Detection accuracy (%)", rotation=90, labelpad=10) + cbar.set_label("Δ accuracy (percentage points)", rotation=90, labelpad=10) + + fig.tight_layout() + os.makedirs(os.path.dirname(out_path), exist_ok=True) + fig.savefig(out_path, dpi=200, bbox_inches="tight") + plt.close(fig) + + +def save_confusion_style_matrix_delta(overlap_results: dict, nonoverlap_results: dict, out_path: str, + title: str = "Technique × Label (Δ accuracy, pp)", + class_sort: str = "accuracy", min_instances: int = 10, + face_overlap_stats: dict | None = None, + x_label_name: str = "Class"): + """ + Confusion-style grid but shows Δ accuracy (pp); no Σ row/col (not well-defined for deltas). + """ + combined_for_order = _merge_results_across_subsets(overlap_results, nonoverlap_results) + techniques = sorted(set(overlap_results.keys()) | set(nonoverlap_results.keys())) + labels = _class_order(combined_for_order, class_sort, min_instances, face_overlap_stats) + if not techniques or not labels: + raise ValueError("No techniques or labels found to plot (check filters).") + + D = _delta_matrix(overlap_results, nonoverlap_results, techniques, labels) + D_masked = np.ma.masked_invalid(D) + + vmax = np.nanmax(np.abs(D)) if np.isfinite(np.nanmax(np.abs(D))) else 1.0 + if vmax == 0: + vmax = 1.0 + + fig_w = max(10, 0.6 * len(labels) + 2) + fig_h = max(5, 0.6 * len(techniques) + 1) + fig, ax = plt.subplots(figsize=(fig_w, fig_h)) + + cmap = plt.cm.RdBu_r + cmap = cmap.copy() + cmap.set_bad("#eeeeee") + im = ax.imshow(D_masked, cmap=cmap, vmin=-vmax, vmax=+vmax, aspect="auto") + + ax.set_xticks(np.arange(len(labels))) + ax.set_yticks(np.arange(len(techniques))) + + if face_overlap_stats and class_sort == "face_iou": + def label_with_iou(c): + info = face_overlap_stats.get(c, {}) + avg = info.get("avg_iou", float("nan")) + return f"{c}\n(μ IoU={avg:.2f})" if not np.isnan(avg) else c + xticklabels = [label_with_iou(c) for c in labels] + else: + xticklabels = labels + + ax.set_xticklabels(xticklabels, rotation=45, ha="right") + ax.set_yticklabels(techniques) + ax.set_xlabel(f"MSCOCO {x_label_name} (Δ overlap−nonoverlap; ≥{min_instances} GT total)") + ax.set_ylabel("Technique") + ax.set_title(title, pad=12) + + # Annotate Δ + for i in range(D.shape[0]): + for j in range(D.shape[1]): + val = D[i, j] + if not np.isnan(val): + ax.text(j, i, f"{val:+.1f}pp", ha="center", va="center", fontsize=8) + + cbar = fig.colorbar(im, ax=ax, fraction=0.046, pad=0.04) + cbar.set_label("Δ accuracy (percentage points)", rotation=90, labelpad=10) fig.tight_layout() os.makedirs(os.path.dirname(out_path), exist_ok=True) @@ -257,13 +534,13 @@ def save_heatmap(results: dict, out_path: str, # ====================== IoU & matching ====================== def _bbox_iou(a, b) -> float: - pa = box(*a) # (minx, miny, maxx, maxy) + pa = box(*a) # (minx, miny, maxx, maxy) pb = box(*b) iou = 0.0 try: inter = pa.intersection(pb).area union = pa.union(pb).area - iou = inter / union if union > 0 else 0.0 + iou = inter / union except Exception as e: print("Exception during bbox_iou", e) iou = 0.0 @@ -271,13 +548,12 @@ def _bbox_iou(a, b) -> float: def _find_best_matching_object(obj, other_objects, min_iou): + ref_label = obj["label"] best = None best_bbox_iou = -1.0 for other in other_objects: - if other.get("_matched"): - continue if other["label"] != ref_label: continue @@ -297,7 +573,6 @@ def _find_best_matching_object(obj, other_objects, min_iou): def _max_iou_with_faces(bbox, face_bboxes) -> float: - """Return max IoU between `bbox` and any face bbox in list. 0.0 if none or empty.""" if not face_bboxes: return 0.0 m = 0.0 @@ -314,12 +589,6 @@ def _max_iou_with_faces(bbox, face_bboxes) -> float: # ====================== Data IO ====================== def get_objects_and_faces(path_to_folder): - """ - Reads all .json files. - Returns two dicts: - objects_by_file: { "": [ {"label": str, "bbox": [x1,y1,x2,y2]}, ... ], ... } - faces_by_file: { "": [ [x1,y1,x2,y2], ... ], ... } # from persons[*].face_bbox - """ objects_by_file = {} faces_by_file = {} @@ -354,7 +623,6 @@ def get_objects_and_faces(path_to_folder): def get_objects(path_to_folder): - """Only returns objects (used for technique folders).""" out = {} for fp in glob(os.path.join(path_to_folder, "*.json")): try: @@ -378,7 +646,6 @@ def get_objects(path_to_folder): def get_after_paths(path_to_folder): - """List of technique subfolders (excludes 'NO_OP' and hidden).""" paths = [] for name in os.listdir(path_to_folder): if name.startswith(".") or name == "NO_OP": @@ -402,20 +669,14 @@ def _object_passes_face_filter(max_iou: float, has_faces: bool, face_filter: str return has_faces and (max_iou > 0.0) if face_filter == "nonoverlap": return has_faces and (max_iou == 0.0) - # "any" - return True + return True # "any" def _compute_metrics_per_technique_face_filtered(before_by_file, faces_by_file, after_by_file, iou_thresh=0.5, face_filter: str = "overlap"): """ Consider GT objects according to `face_filter` and compute per-class detection accuracy. - - Returns: - { - "overall": {"gt_objects": int, "matched": int, "detection_accuracy": float}, - "per_class": {class_label: {"gt_objects": int, "matched": int, "detection_accuracy": float}, ...} - } + Returns technique metrics with 'per_class' keyed by CLASS label. """ total_gt = 0 matched_gt = 0 @@ -537,9 +798,9 @@ def _merge_results_across_datasets(results_list): # overall tgt["overall"]["gt_objects"] += int(metrics["overall"].get("gt_objects", 0)) tgt["overall"]["matched"] += int(metrics["overall"].get("matched", 0)) - # per class - for cls, stats in metrics.get("per_class", {}).items(): - pc = tgt["per_class"].setdefault(cls, {"gt_objects": 0, "matched": 0, "detection_accuracy": 0.0}) + # per label (currently class) + for lbl, stats in metrics.get("per_class", {}).items(): + pc = tgt["per_class"].setdefault(lbl, {"gt_objects": 0, "matched": 0, "detection_accuracy": 0.0}) pc["gt_objects"] += int(stats.get("gt_objects", 0)) pc["matched"] += int(stats.get("matched", 0)) @@ -548,7 +809,7 @@ def _merge_results_across_datasets(results_list): tot = metrics["overall"]["gt_objects"] mat = metrics["overall"]["matched"] metrics["overall"]["detection_accuracy"] = (mat / tot) if tot > 0 else 0.0 - for cls, stats in metrics["per_class"].items(): + for lbl, stats in metrics["per_class"].items(): ct = stats["gt_objects"] cm = stats["matched"] stats["detection_accuracy"] = (cm / ct) if ct > 0 else 0.0 @@ -558,100 +819,31 @@ def _merge_results_across_datasets(results_list): def _merge_face_stats_across_datasets(face_stats_list): """ Merge per-dataset face-overlap stats: - Input: list of {cls: {"count": n, "sum_iou": s, "avg_iou": ...}} - Output: {cls: {"count": N, "sum_iou": S, "avg_iou": S/N}} + Input: list of {label: {"count": n, "sum_iou": s, "avg_iou": ...}} + Output: {label: {"count": N, "sum_iou": S, "avg_iou": S/N}} """ merged_counts = defaultdict(int) merged_sums = defaultdict(float) for stats in face_stats_list: - for cls, d in stats.items(): - merged_counts[cls] += int(d.get("count", 0)) - merged_sums[cls] += float(d.get("sum_iou", 0.0)) + for lbl, d in stats.items(): + merged_counts[lbl] += int(d.get("count", 0)) + merged_sums[lbl] += float(d.get("sum_iou", 0.0)) merged = {} - for cls in merged_counts.keys(): - n = merged_counts[cls] - s = merged_sums[cls] - merged[cls] = {"count": n, "sum_iou": s, "avg_iou": (s / n) if n > 0 else float("nan")} + for lbl in merged_counts.keys(): + n = merged_counts[lbl] + s = merged_sums[lbl] + merged[lbl] = {"count": n, "sum_iou": s, "avg_iou": (s / n) if n > 0 else float("nan")} return merged -# ====================== Data IO helpers (unchanged) ====================== - -def get_objects_and_faces(path_to_folder): - objects_by_file = {} - faces_by_file = {} - - for fp in glob(os.path.join(path_to_folder, "*.json")): - stem = os.path.splitext(os.path.basename(fp))[0] - objects = [] - faces = [] - try: - with open(fp, "r", encoding="utf-8") as f: - data = json.load(f) - except Exception as e: - print(f"Failed to load {fp}: {e}") - continue - - for o in data.get("objects", []): - label = o.get("label") - bbox = o.get("bbox") - if label is None or bbox is None or not isinstance(bbox, (list, tuple)) or len(bbox) != 4: - continue - objects.append({"label": str(label), "bbox": list(bbox)}) - - for p in data.get("persons", []): - fb = p.get("face_bbox") - if fb is None or not isinstance(fb, (list, tuple)) or len(fb) != 4: - continue - faces.append(list(fb)) - - objects_by_file[stem] = objects - faces_by_file[stem] = faces - - return objects_by_file, faces_by_file - - -def get_objects(path_to_folder): - out = {} - for fp in glob(os.path.join(path_to_folder, "*.json")): - try: - with open(fp, "r", encoding="utf-8") as f: - data = json.load(f) - except Exception as e: - print(f"Failed to load {fp}: {e}") - continue - - objs = [] - for o in data.get("objects", []): - label = o.get("label") - bbox = o.get("bbox") - if label is None or bbox is None or not isinstance(bbox, (list, tuple)) or len(bbox) != 4: - continue - objs.append({"label": str(label), "bbox": list(bbox)}) - - key = os.path.splitext(os.path.basename(fp))[0] - out[key] = objs - return out - - -def get_after_paths(path_to_folder): - paths = [] - for name in os.listdir(path_to_folder): - if name.startswith(".") or name == "NO_OP": - continue - p = os.path.join(path_to_folder, name) - if os.path.isdir(p): - paths.append(p) - return sorted(paths) - - # ====================== CLI / Main ====================== def main(): parser = argparse.ArgumentParser( description="Compute detection accuracy per technique (IoU≥0.5, same class), " - "with face-overlap filtering (overlap/nonoverlap/any), optional two-dataset merge, " - "min-instance filtering, and Technique×Class plots." + "with face filtering (overlap/nonoverlap/any) OR plot Δ (overlap−nonoverlap), " + "optional two-dataset merge, optional grouping to super-categories, " + "min-instance filtering, and plots." ) # Dataset A (required) parser.add_argument("--before", required=True, help="Path to ground-truth folder (dataset A).") @@ -660,21 +852,24 @@ def main(): parser.add_argument("--before2", default=None, help="Path to second ground-truth folder (dataset B).") parser.add_argument("--after_base2", default=None, help="Path to folder with technique subfolders (dataset B).") - parser.add_argument("--out", required=True, help="Path to write GLOBAL (merged) results JSON.") + parser.add_argument("--out", required=True, + help="Path to write results JSON. In delta mode, writes {'overlap':..., 'nonoverlap':...}.") parser.add_argument("--out_per_dataset", default=None, - help="Optional path to write per-dataset results JSON (contains keys 'dataset1'/'dataset2').") + help="Optional path to write per-dataset results JSON (contains keys for each dataset).") parser.add_argument("--iou", type=float, default=0.5, help="IoU threshold for matching objects (default 0.5).") parser.add_argument("--min_instances", type=int, default=10, - help="Only include classes with at least this many GT instances (default 10) in plots.") + help="Only include labels with at least this many GT instances (default 10) in plots.") parser.add_argument("--class_sort", choices=["accuracy", "prevalence", "alpha", "face_iou"], default="accuracy", - help="Order class columns by accuracy, prevalence (GT count), alphabetically, or by avg IoU to face.") - parser.add_argument("--face_filter", choices=["overlap", "nonoverlap", "any"], default="overlap", - help="Which GT objects to consider: overlap with a face, do not overlap, or any.") + help="Order label columns by accuracy, prevalence (GT count), alphabetically, or by avg IoU to face.") + parser.add_argument("--face_mode", choices=["overlap", "nonoverlap", "any", "delta"], default="overlap", + help="Which GT objects to evaluate/plot: overlap, nonoverlap, any, or Δ (overlap−nonoverlap).") + parser.add_argument("--group_by", choices=["class", "super"], default="class", + help="Plot label space: 'class' (default) or MSCOCO 'super' categories.") parser.add_argument("--heatmap_out", default=None, - help="Directory to save plots; files 'confusion_.pdf' and 'heatmap_.pdf' are created.") - parser.add_argument("--heatmap_title", default="Technique × Class", + help="Directory to save plots; files are created with suffixes based on group & sort.") + parser.add_argument("--heatmap_title", default="Technique × Label", help="Title to show on the plots.") args = parser.parse_args() @@ -682,85 +877,176 @@ def main(): if (args.before2 and not args.after_base2) or (args.after_base2 and not args.before2): raise ValueError("If you provide --before2, you must also provide --after_base2 (and vice versa).") - # Compute per-dataset results + face IoU stats under the chosen face_filter - print("Computing dataset A results…") - results_ds1, face_stats_ds1 = _compute_results_for_dataset(args.before, args.after_base, args.iou, args.face_filter) + # ---------- NON-DELTA MODES ---------- + if args.face_mode in ("overlap", "nonoverlap", "any"): + face_filter = args.face_mode - results_list = [results_ds1] - face_stats_list = [face_stats_ds1] - per_dataset_out = {"dataset1": results_ds1, "face_stats1": face_stats_ds1} + # Compute per-dataset results + face IoU stats under the chosen filter + print("Computing dataset A results…") + results_ds1, face_stats_ds1 = _compute_results_for_dataset(args.before, args.after_base, args.iou, face_filter) + + results_list = [results_ds1] + face_stats_list = [face_stats_ds1] + per_dataset_out = {"dataset1": results_ds1, "face_stats1": face_stats_ds1} + + if args.before2 and args.after_base2: + print("Computing dataset B results…") + results_ds2, face_stats_ds2 = _compute_results_for_dataset(args.before2, args.after_base2, args.iou, face_filter) + results_list.append(results_ds2) + face_stats_list.append(face_stats_ds2) + per_dataset_out["dataset2"] = results_ds2 + per_dataset_out["face_stats2"] = face_stats_ds2 + + # Merge into global (per-class internally) + print("Merging datasets into GLOBAL results…") + results_global = _merge_results_across_datasets(results_list) + face_stats_global = _merge_face_stats_across_datasets(face_stats_list) + + # Save GLOBAL results JSON (per-class) + os.makedirs(os.path.dirname(args.out), exist_ok=True) + with open(args.out, "w", encoding="utf-8") as f: + json.dump(results_global, f, indent=2) + print(f"[OK] Wrote GLOBAL metrics to: {args.out}") + + # Optionally save per-dataset results + if args.out_per_dataset: + os.makedirs(os.path.dirname(args.out_per_dataset), exist_ok=True) + with open(args.out_per_dataset, "w", encoding="utf-8") as f: + json.dump(per_dataset_out, f, indent=2) + print(f"[OK] Wrote per-dataset metrics to: {args.out_per_dataset}") + + # Prepare label space for plots (class or super) + results_for_plot = _regroup_results_to(results_global, args.group_by) + face_stats_for_plot = _regroup_face_stats_to(face_stats_global, args.group_by) + x_label_name = "Super-Category" if args.group_by == "super" else "Class" + + # Optional plots + if args.heatmap_out: + try: + os.makedirs(args.heatmap_out, exist_ok=True) + save_confusion_style_matrix( + results_for_plot, + os.path.join(args.heatmap_out, f"confusion_{args.group_by}_{args.class_sort}.pdf"), + title=f"{args.heatmap_title} (matched/GT; %)", + class_sort=args.class_sort, + min_instances=args.min_instances, + face_overlap_stats=face_stats_for_plot, + face_mode=args.face_mode, + x_label_name=x_label_name, + ) + save_heatmap( + results_for_plot, + os.path.join(args.heatmap_out, f"heatmap_{args.group_by}_{args.class_sort}.pdf"), + title=f"{args.heatmap_title} (accuracy %)", + class_sort=args.class_sort, + min_instances=args.min_instances, + face_overlap_stats=face_stats_for_plot, + face_mode=args.face_mode, + x_label_name=x_label_name, + ) + print(f"[OK] Wrote figures to: {args.heatmap_out}") + except Exception as e: + print(f"[WARN] Could not create figures: {e}") + + return + + # ---------- DELTA MODE ---------- + # Compute overlap subset + print("Computing OVERLAP results…") + o_ds1, o_face1 = _compute_results_for_dataset(args.before, args.after_base, args.iou, "overlap") + o_list = [o_ds1]; o_face_list = [o_face1] + per_dataset_out = {"overlap_dataset1": o_ds1, "overlap_face_stats1": o_face1} if args.before2 and args.after_base2: - print("Computing dataset B results…") - results_ds2, face_stats_ds2 = _compute_results_for_dataset(args.before2, args.after_base2, args.iou, args.face_filter) - results_list.append(results_ds2) - face_stats_list.append(face_stats_ds2) - per_dataset_out["dataset2"] = results_ds2 - per_dataset_out["face_stats2"] = face_stats_ds2 + print("Computing OVERLAP results (dataset B)…") + o_ds2, o_face2 = _compute_results_for_dataset(args.before2, args.after_base2, args.iou, "overlap") + o_list.append(o_ds2); o_face_list.append(o_face2) + per_dataset_out["overlap_dataset2"] = o_ds2 + per_dataset_out["overlap_face_stats2"] = o_face2 - # Merge into global - print("Merging datasets into GLOBAL results…") - results_global = _merge_results_across_datasets(results_list) - face_stats_global = _merge_face_stats_across_datasets(face_stats_list) + results_global_overlap = _merge_results_across_datasets(o_list) + face_stats_overlap = _merge_face_stats_across_datasets(o_face_list) - # Save GLOBAL results JSON + # Compute nonoverlap subset + print("Computing NONOVERLAP results…") + n_ds1, n_face1 = _compute_results_for_dataset(args.before, args.after_base, args.iou, "nonoverlap") + n_list = [n_ds1]; n_face_list = [n_face1] + per_dataset_out["nonoverlap_dataset1"] = n_ds1 + per_dataset_out["nonoverlap_face_stats1"] = n_face1 + + if args.before2 and args.after_base2: + print("Computing NONOVERLAP results (dataset B)…") + n_ds2, n_face2 = _compute_results_for_dataset(args.before2, args.after_base2, args.iou, "nonoverlap") + n_list.append(n_ds2); n_face_list.append(n_face2) + per_dataset_out["nonoverlap_dataset2"] = n_ds2 + per_dataset_out["nonoverlap_face_stats2"] = n_face2 + + results_global_nonoverlap = _merge_results_across_datasets(n_list) + face_stats_nonoverlap = _merge_face_stats_across_datasets(n_face_list) # mostly zeros + + # Save JSON with both subsets os.makedirs(os.path.dirname(args.out), exist_ok=True) with open(args.out, "w", encoding="utf-8") as f: - json.dump(results_global, f, indent=2) - print(f"[OK] Wrote GLOBAL metrics to: {args.out}") + json.dump({"overlap": results_global_overlap, + "nonoverlap": results_global_nonoverlap}, f, indent=2) + print(f"[OK] Wrote OVERLAP & NONOVERLAP metrics to: {args.out}") - # Optionally save per-dataset results (for transparency/debugging) if args.out_per_dataset: os.makedirs(os.path.dirname(args.out_per_dataset), exist_ok=True) with open(args.out_per_dataset, "w", encoding="utf-8") as f: json.dump(per_dataset_out, f, indent=2) print(f"[OK] Wrote per-dataset metrics to: {args.out_per_dataset}") - # Optional plots (use GLOBAL merged results) + # Regroup for plots + ro_plot = _regroup_results_to(results_global_overlap, args.group_by) + rn_plot = _regroup_results_to(results_global_nonoverlap, args.group_by) + face_stats_for_plot = _regroup_face_stats_to(face_stats_overlap, args.group_by) # use overlap IoU for sorting + x_label_name = "Super-Category" if args.group_by == "super" else "Class" + + # Delta plots if args.heatmap_out: try: os.makedirs(args.heatmap_out, exist_ok=True) - save_confusion_style_matrix( - results_global, - os.path.join(args.heatmap_out, f"confusion_{args.class_sort}.pdf"), - title=f"{args.heatmap_title} (matched/GT; %)", + save_confusion_style_matrix_delta( + ro_plot, rn_plot, + os.path.join(args.heatmap_out, f"confusion_delta_{args.group_by}_{args.class_sort}.pdf"), + title=f"{args.heatmap_title} (Δ accuracy, pp)", class_sort=args.class_sort, min_instances=args.min_instances, - face_overlap_stats=face_stats_global, - face_filter=args.face_filter, + face_overlap_stats=face_stats_for_plot, + x_label_name=x_label_name, ) - save_heatmap( - results_global, - os.path.join(args.heatmap_out, f"heatmap_{args.class_sort}.pdf"), - title=f"{args.heatmap_title} (accuracy %)", + save_heatmap_delta( + ro_plot, rn_plot, + os.path.join(args.heatmap_out, f"heatmap_delta_{args.group_by}_{args.class_sort}.pdf"), + title=f"{args.heatmap_title} (Δ overlap − nonoverlap, pp)", class_sort=args.class_sort, min_instances=args.min_instances, - face_overlap_stats=face_stats_global, - face_filter=args.face_filter, + face_overlap_stats=face_stats_for_plot, + x_label_name=x_label_name, ) - print(f"[OK] Wrote figures to: {args.heatmap_out}") + print(f"[OK] Wrote Δ figures to: {args.heatmap_out}") except Exception as e: - print(f"[WARN] Could not create figures: {e}") + print(f"[WARN] Could not create Δ figures: {e}") if __name__ == "__main__": main() - #TODO: Prüfen ist das matching noch korrekt? Sehr wichtig +#TODO: Sehr wichtig, nochmal matching anpassen -#TODO: 1. Min. Anzahl filtern MUSS KLAPPEN +#Überblick über alle objekt super kategorien (prävalenz) + #Man sieht, dass prinzipiell alle kategorien betroffen sind + #accessory - am meisten prävalent + #Tie am meisten vorkommende Klasse + #Ohne overlap XXX + #Mit overlap XXX + #ODER ANDERE KLASSE MIT DELTA - (z.b Electronic) hat krassen drop + # -#TODO: 2. TOP-N Überlappungsgrad sortierung - -#Zwei grafiken - -#TODO: Schlechteste Accuracy -#TODO: Meiste IoU mit Gesicht - - #python class_object_analysis.py --before C:/Users/bijan/Desktop/obfuscation_platform/project/datasets/filtered_yolom_yunet/celeba --after_base C:/Users/bijan/Desktop/obfuscation_platform/project/datasets/obfuscated_yolom_yunet/celeba --before2 C:/Users/bijan/Desktop/obfuscation_platform/project/datasets/filtered_yolom_yunet/wider --after_base2 C:/Users/bijan/Desktop/obfuscation_platform/project/datasets/obfuscated_yolom_yunet/wider --out results/global.json --out_per_dataset C:\Users\bijan\Desktop\obfuscation_platform\project\evaluation_results\class_analysis_0.5.json --heatmap_out C:/Users/bijan/Desktop/obfuscation_platform/project/visual_results/in_paper/object_class_analysis --class_sort prevalence --iou 0.5 \ No newline at end of file diff --git a/project/results/global.json b/project/results/global.json new file mode 100644 index 0000000..632fe11 --- /dev/null +++ b/project/results/global.json @@ -0,0 +1,1990 @@ +{ + "Black": { + "overall": { + "gt_objects": 684, + "matched": 333, + "detection_accuracy": 0.4868421052631579 + }, + "per_class": { + "banana": { + "gt_objects": 4, + "matched": 1, + "detection_accuracy": 0.25 + }, + "baseball bat": { + "gt_objects": 19, + "matched": 7, + "detection_accuracy": 0.3684210526315789 + }, + "bed": { + "gt_objects": 32, + "matched": 20, + "detection_accuracy": 0.625 + }, + "bird": { + "gt_objects": 7, + "matched": 4, + "detection_accuracy": 0.5714285714285714 + }, + "book": { + "gt_objects": 10, + "matched": 5, + "detection_accuracy": 0.5 + }, + "bottle": { + "gt_objects": 8, + "matched": 5, + "detection_accuracy": 0.625 + }, + "car": { + "gt_objects": 43, + "matched": 32, + "detection_accuracy": 0.7441860465116279 + }, + "cat": { + "gt_objects": 4, + "matched": 4, + "detection_accuracy": 1.0 + }, + "cell phone": { + "gt_objects": 67, + "matched": 3, + "detection_accuracy": 0.04477611940298507 + }, + "chair": { + "gt_objects": 41, + "matched": 16, + "detection_accuracy": 0.3902439024390244 + }, + "couch": { + "gt_objects": 41, + "matched": 27, + "detection_accuracy": 0.6585365853658537 + }, + "dog": { + "gt_objects": 15, + "matched": 6, + "detection_accuracy": 0.4 + }, + "donut": { + "gt_objects": 6, + "matched": 0, + "detection_accuracy": 0.0 + }, + "fork": { + "gt_objects": 1, + "matched": 0, + "detection_accuracy": 0.0 + }, + "hair drier": { + "gt_objects": 2, + "matched": 1, + "detection_accuracy": 0.5 + }, + "handbag": { + "gt_objects": 6, + "matched": 5, + "detection_accuracy": 0.8333333333333334 + }, + "horse": { + "gt_objects": 5, + "matched": 5, + "detection_accuracy": 1.0 + }, + "motorcycle": { + "gt_objects": 5, + "matched": 4, + "detection_accuracy": 0.8 + }, + "potted plant": { + "gt_objects": 7, + "matched": 5, + "detection_accuracy": 0.7142857142857143 + }, + "refrigerator": { + "gt_objects": 6, + "matched": 4, + "detection_accuracy": 0.6666666666666666 + }, + "remote": { + "gt_objects": 3, + "matched": 1, + "detection_accuracy": 0.3333333333333333 + }, + "skateboard": { + "gt_objects": 5, + "matched": 1, + "detection_accuracy": 0.2 + }, + "snowboard": { + "gt_objects": 2, + "matched": 0, + "detection_accuracy": 0.0 + }, + "sports ball": { + "gt_objects": 12, + "matched": 7, + "detection_accuracy": 0.5833333333333334 + }, + "stop sign": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "teddy bear": { + "gt_objects": 8, + "matched": 7, + "detection_accuracy": 0.875 + }, + "tennis racket": { + "gt_objects": 20, + "matched": 17, + "detection_accuracy": 0.85 + }, + "tie": { + "gt_objects": 175, + "matched": 88, + "detection_accuracy": 0.5028571428571429 + }, + "toothbrush": { + "gt_objects": 20, + "matched": 4, + "detection_accuracy": 0.2 + }, + "truck": { + "gt_objects": 9, + "matched": 7, + "detection_accuracy": 0.7777777777777778 + }, + "tv": { + "gt_objects": 22, + "matched": 10, + "detection_accuracy": 0.45454545454545453 + }, + "umbrella": { + "gt_objects": 16, + "matched": 5, + "detection_accuracy": 0.3125 + }, + "wine glass": { + "gt_objects": 4, + "matched": 1, + "detection_accuracy": 0.25 + }, + "airplane": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "backpack": { + "gt_objects": 5, + "matched": 2, + "detection_accuracy": 0.4 + }, + "baseball glove": { + "gt_objects": 5, + "matched": 0, + "detection_accuracy": 0.0 + }, + "bench": { + "gt_objects": 4, + "matched": 2, + "detection_accuracy": 0.5 + }, + "boat": { + "gt_objects": 5, + "matched": 3, + "detection_accuracy": 0.6 + }, + "bowl": { + "gt_objects": 1, + "matched": 0, + "detection_accuracy": 0.0 + }, + "bus": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "cake": { + "gt_objects": 2, + "matched": 1, + "detection_accuracy": 0.5 + }, + "clock": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "cow": { + "gt_objects": 3, + "matched": 1, + "detection_accuracy": 0.3333333333333333 + }, + "cup": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "dining table": { + "gt_objects": 1, + "matched": 0, + "detection_accuracy": 0.0 + }, + "frisbee": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "giraffe": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "kite": { + "gt_objects": 2, + "matched": 1, + "detection_accuracy": 0.5 + }, + "laptop": { + "gt_objects": 6, + "matched": 3, + "detection_accuracy": 0.5 + }, + "microwave": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "scissors": { + "gt_objects": 2, + "matched": 1, + "detection_accuracy": 0.5 + }, + "skis": { + "gt_objects": 3, + "matched": 1, + "detection_accuracy": 0.3333333333333333 + }, + "suitcase": { + "gt_objects": 1, + "matched": 0, + "detection_accuracy": 0.0 + }, + "surfboard": { + "gt_objects": 8, + "matched": 5, + "detection_accuracy": 0.625 + }, + "vase": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + } + } + }, + "Blur": { + "overall": { + "gt_objects": 684, + "matched": 402, + "detection_accuracy": 0.5877192982456141 + }, + "per_class": { + "banana": { + "gt_objects": 4, + "matched": 1, + "detection_accuracy": 0.25 + }, + "baseball bat": { + "gt_objects": 19, + "matched": 6, + "detection_accuracy": 0.3157894736842105 + }, + "bed": { + "gt_objects": 32, + "matched": 22, + "detection_accuracy": 0.6875 + }, + "bird": { + "gt_objects": 7, + "matched": 4, + "detection_accuracy": 0.5714285714285714 + }, + "book": { + "gt_objects": 10, + "matched": 8, + "detection_accuracy": 0.8 + }, + "bottle": { + "gt_objects": 8, + "matched": 4, + "detection_accuracy": 0.5 + }, + "car": { + "gt_objects": 43, + "matched": 37, + "detection_accuracy": 0.8604651162790697 + }, + "cat": { + "gt_objects": 4, + "matched": 4, + "detection_accuracy": 1.0 + }, + "cell phone": { + "gt_objects": 67, + "matched": 11, + "detection_accuracy": 0.16417910447761194 + }, + "chair": { + "gt_objects": 41, + "matched": 23, + "detection_accuracy": 0.5609756097560976 + }, + "couch": { + "gt_objects": 41, + "matched": 32, + "detection_accuracy": 0.7804878048780488 + }, + "dog": { + "gt_objects": 15, + "matched": 6, + "detection_accuracy": 0.4 + }, + "donut": { + "gt_objects": 6, + "matched": 0, + "detection_accuracy": 0.0 + }, + "fork": { + "gt_objects": 1, + "matched": 0, + "detection_accuracy": 0.0 + }, + "hair drier": { + "gt_objects": 2, + "matched": 1, + "detection_accuracy": 0.5 + }, + "handbag": { + "gt_objects": 6, + "matched": 5, + "detection_accuracy": 0.8333333333333334 + }, + "horse": { + "gt_objects": 5, + "matched": 5, + "detection_accuracy": 1.0 + }, + "motorcycle": { + "gt_objects": 5, + "matched": 4, + "detection_accuracy": 0.8 + }, + "potted plant": { + "gt_objects": 7, + "matched": 6, + "detection_accuracy": 0.8571428571428571 + }, + "refrigerator": { + "gt_objects": 6, + "matched": 4, + "detection_accuracy": 0.6666666666666666 + }, + "remote": { + "gt_objects": 3, + "matched": 1, + "detection_accuracy": 0.3333333333333333 + }, + "skateboard": { + "gt_objects": 5, + "matched": 4, + "detection_accuracy": 0.8 + }, + "snowboard": { + "gt_objects": 2, + "matched": 0, + "detection_accuracy": 0.0 + }, + "sports ball": { + "gt_objects": 12, + "matched": 7, + "detection_accuracy": 0.5833333333333334 + }, + "stop sign": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "teddy bear": { + "gt_objects": 8, + "matched": 8, + "detection_accuracy": 1.0 + }, + "tennis racket": { + "gt_objects": 20, + "matched": 18, + "detection_accuracy": 0.9 + }, + "tie": { + "gt_objects": 175, + "matched": 102, + "detection_accuracy": 0.5828571428571429 + }, + "toothbrush": { + "gt_objects": 20, + "matched": 5, + "detection_accuracy": 0.25 + }, + "truck": { + "gt_objects": 9, + "matched": 9, + "detection_accuracy": 1.0 + }, + "tv": { + "gt_objects": 22, + "matched": 12, + "detection_accuracy": 0.5454545454545454 + }, + "umbrella": { + "gt_objects": 16, + "matched": 12, + "detection_accuracy": 0.75 + }, + "wine glass": { + "gt_objects": 4, + "matched": 1, + "detection_accuracy": 0.25 + }, + "airplane": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "backpack": { + "gt_objects": 5, + "matched": 1, + "detection_accuracy": 0.2 + }, + "baseball glove": { + "gt_objects": 5, + "matched": 3, + "detection_accuracy": 0.6 + }, + "bench": { + "gt_objects": 4, + "matched": 3, + "detection_accuracy": 0.75 + }, + "boat": { + "gt_objects": 5, + "matched": 4, + "detection_accuracy": 0.8 + }, + "bowl": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "bus": { + "gt_objects": 2, + "matched": 1, + "detection_accuracy": 0.5 + }, + "cake": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "clock": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "cow": { + "gt_objects": 3, + "matched": 1, + "detection_accuracy": 0.3333333333333333 + }, + "cup": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "dining table": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "frisbee": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "giraffe": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "kite": { + "gt_objects": 2, + "matched": 1, + "detection_accuracy": 0.5 + }, + "laptop": { + "gt_objects": 6, + "matched": 4, + "detection_accuracy": 0.6666666666666666 + }, + "microwave": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "scissors": { + "gt_objects": 2, + "matched": 1, + "detection_accuracy": 0.5 + }, + "skis": { + "gt_objects": 3, + "matched": 3, + "detection_accuracy": 1.0 + }, + "suitcase": { + "gt_objects": 1, + "matched": 0, + "detection_accuracy": 0.0 + }, + "surfboard": { + "gt_objects": 8, + "matched": 5, + "detection_accuracy": 0.625 + }, + "vase": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + } + } + }, + "Pixel": { + "overall": { + "gt_objects": 684, + "matched": 322, + "detection_accuracy": 0.47076023391812866 + }, + "per_class": { + "banana": { + "gt_objects": 4, + "matched": 0, + "detection_accuracy": 0.0 + }, + "baseball bat": { + "gt_objects": 19, + "matched": 6, + "detection_accuracy": 0.3157894736842105 + }, + "bed": { + "gt_objects": 32, + "matched": 19, + "detection_accuracy": 0.59375 + }, + "bird": { + "gt_objects": 7, + "matched": 4, + "detection_accuracy": 0.5714285714285714 + }, + "book": { + "gt_objects": 10, + "matched": 6, + "detection_accuracy": 0.6 + }, + "bottle": { + "gt_objects": 8, + "matched": 4, + "detection_accuracy": 0.5 + }, + "car": { + "gt_objects": 43, + "matched": 38, + "detection_accuracy": 0.8837209302325582 + }, + "cat": { + "gt_objects": 4, + "matched": 4, + "detection_accuracy": 1.0 + }, + "cell phone": { + "gt_objects": 67, + "matched": 5, + "detection_accuracy": 0.07462686567164178 + }, + "chair": { + "gt_objects": 41, + "matched": 13, + "detection_accuracy": 0.3170731707317073 + }, + "couch": { + "gt_objects": 41, + "matched": 24, + "detection_accuracy": 0.5853658536585366 + }, + "dog": { + "gt_objects": 15, + "matched": 3, + "detection_accuracy": 0.2 + }, + "donut": { + "gt_objects": 6, + "matched": 0, + "detection_accuracy": 0.0 + }, + "fork": { + "gt_objects": 1, + "matched": 0, + "detection_accuracy": 0.0 + }, + "hair drier": { + "gt_objects": 2, + "matched": 1, + "detection_accuracy": 0.5 + }, + "handbag": { + "gt_objects": 6, + "matched": 5, + "detection_accuracy": 0.8333333333333334 + }, + "horse": { + "gt_objects": 5, + "matched": 5, + "detection_accuracy": 1.0 + }, + "motorcycle": { + "gt_objects": 5, + "matched": 4, + "detection_accuracy": 0.8 + }, + "potted plant": { + "gt_objects": 7, + "matched": 4, + "detection_accuracy": 0.5714285714285714 + }, + "refrigerator": { + "gt_objects": 6, + "matched": 3, + "detection_accuracy": 0.5 + }, + "remote": { + "gt_objects": 3, + "matched": 1, + "detection_accuracy": 0.3333333333333333 + }, + "skateboard": { + "gt_objects": 5, + "matched": 0, + "detection_accuracy": 0.0 + }, + "snowboard": { + "gt_objects": 2, + "matched": 0, + "detection_accuracy": 0.0 + }, + "sports ball": { + "gt_objects": 12, + "matched": 6, + "detection_accuracy": 0.5 + }, + "stop sign": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "teddy bear": { + "gt_objects": 8, + "matched": 7, + "detection_accuracy": 0.875 + }, + "tennis racket": { + "gt_objects": 20, + "matched": 17, + "detection_accuracy": 0.85 + }, + "tie": { + "gt_objects": 175, + "matched": 74, + "detection_accuracy": 0.4228571428571429 + }, + "toothbrush": { + "gt_objects": 20, + "matched": 5, + "detection_accuracy": 0.25 + }, + "truck": { + "gt_objects": 9, + "matched": 7, + "detection_accuracy": 0.7777777777777778 + }, + "tv": { + "gt_objects": 22, + "matched": 11, + "detection_accuracy": 0.5 + }, + "umbrella": { + "gt_objects": 16, + "matched": 9, + "detection_accuracy": 0.5625 + }, + "wine glass": { + "gt_objects": 4, + "matched": 1, + "detection_accuracy": 0.25 + }, + "airplane": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "backpack": { + "gt_objects": 5, + "matched": 2, + "detection_accuracy": 0.4 + }, + "baseball glove": { + "gt_objects": 5, + "matched": 1, + "detection_accuracy": 0.2 + }, + "bench": { + "gt_objects": 4, + "matched": 2, + "detection_accuracy": 0.5 + }, + "boat": { + "gt_objects": 5, + "matched": 3, + "detection_accuracy": 0.6 + }, + "bowl": { + "gt_objects": 1, + "matched": 0, + "detection_accuracy": 0.0 + }, + "bus": { + "gt_objects": 2, + "matched": 1, + "detection_accuracy": 0.5 + }, + "cake": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "clock": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "cow": { + "gt_objects": 3, + "matched": 1, + "detection_accuracy": 0.3333333333333333 + }, + "cup": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "dining table": { + "gt_objects": 1, + "matched": 0, + "detection_accuracy": 0.0 + }, + "frisbee": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "giraffe": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "kite": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "laptop": { + "gt_objects": 6, + "matched": 4, + "detection_accuracy": 0.6666666666666666 + }, + "microwave": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "scissors": { + "gt_objects": 2, + "matched": 1, + "detection_accuracy": 0.5 + }, + "skis": { + "gt_objects": 3, + "matched": 2, + "detection_accuracy": 0.6666666666666666 + }, + "suitcase": { + "gt_objects": 1, + "matched": 0, + "detection_accuracy": 0.0 + }, + "surfboard": { + "gt_objects": 8, + "matched": 6, + "detection_accuracy": 0.75 + }, + "vase": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + } + } + }, + "Random": { + "overall": { + "gt_objects": 684, + "matched": 369, + "detection_accuracy": 0.5394736842105263 + }, + "per_class": { + "banana": { + "gt_objects": 4, + "matched": 0, + "detection_accuracy": 0.0 + }, + "baseball bat": { + "gt_objects": 19, + "matched": 5, + "detection_accuracy": 0.2631578947368421 + }, + "bed": { + "gt_objects": 32, + "matched": 20, + "detection_accuracy": 0.625 + }, + "bird": { + "gt_objects": 7, + "matched": 4, + "detection_accuracy": 0.5714285714285714 + }, + "book": { + "gt_objects": 10, + "matched": 8, + "detection_accuracy": 0.8 + }, + "bottle": { + "gt_objects": 8, + "matched": 5, + "detection_accuracy": 0.625 + }, + "car": { + "gt_objects": 43, + "matched": 37, + "detection_accuracy": 0.8604651162790697 + }, + "cat": { + "gt_objects": 4, + "matched": 4, + "detection_accuracy": 1.0 + }, + "cell phone": { + "gt_objects": 67, + "matched": 4, + "detection_accuracy": 0.05970149253731343 + }, + "chair": { + "gt_objects": 41, + "matched": 20, + "detection_accuracy": 0.4878048780487805 + }, + "couch": { + "gt_objects": 41, + "matched": 29, + "detection_accuracy": 0.7073170731707317 + }, + "dog": { + "gt_objects": 15, + "matched": 7, + "detection_accuracy": 0.4666666666666667 + }, + "donut": { + "gt_objects": 6, + "matched": 0, + "detection_accuracy": 0.0 + }, + "fork": { + "gt_objects": 1, + "matched": 0, + "detection_accuracy": 0.0 + }, + "hair drier": { + "gt_objects": 2, + "matched": 1, + "detection_accuracy": 0.5 + }, + "handbag": { + "gt_objects": 6, + "matched": 5, + "detection_accuracy": 0.8333333333333334 + }, + "horse": { + "gt_objects": 5, + "matched": 5, + "detection_accuracy": 1.0 + }, + "motorcycle": { + "gt_objects": 5, + "matched": 4, + "detection_accuracy": 0.8 + }, + "potted plant": { + "gt_objects": 7, + "matched": 5, + "detection_accuracy": 0.7142857142857143 + }, + "refrigerator": { + "gt_objects": 6, + "matched": 3, + "detection_accuracy": 0.5 + }, + "remote": { + "gt_objects": 3, + "matched": 1, + "detection_accuracy": 0.3333333333333333 + }, + "skateboard": { + "gt_objects": 5, + "matched": 4, + "detection_accuracy": 0.8 + }, + "snowboard": { + "gt_objects": 2, + "matched": 0, + "detection_accuracy": 0.0 + }, + "sports ball": { + "gt_objects": 12, + "matched": 6, + "detection_accuracy": 0.5 + }, + "stop sign": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "teddy bear": { + "gt_objects": 8, + "matched": 8, + "detection_accuracy": 1.0 + }, + "tennis racket": { + "gt_objects": 20, + "matched": 16, + "detection_accuracy": 0.8 + }, + "tie": { + "gt_objects": 175, + "matched": 100, + "detection_accuracy": 0.5714285714285714 + }, + "toothbrush": { + "gt_objects": 20, + "matched": 4, + "detection_accuracy": 0.2 + }, + "truck": { + "gt_objects": 9, + "matched": 6, + "detection_accuracy": 0.6666666666666666 + }, + "tv": { + "gt_objects": 22, + "matched": 10, + "detection_accuracy": 0.45454545454545453 + }, + "umbrella": { + "gt_objects": 16, + "matched": 11, + "detection_accuracy": 0.6875 + }, + "wine glass": { + "gt_objects": 4, + "matched": 1, + "detection_accuracy": 0.25 + }, + "airplane": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "backpack": { + "gt_objects": 5, + "matched": 2, + "detection_accuracy": 0.4 + }, + "baseball glove": { + "gt_objects": 5, + "matched": 0, + "detection_accuracy": 0.0 + }, + "bench": { + "gt_objects": 4, + "matched": 3, + "detection_accuracy": 0.75 + }, + "boat": { + "gt_objects": 5, + "matched": 3, + "detection_accuracy": 0.6 + }, + "bowl": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "bus": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "cake": { + "gt_objects": 2, + "matched": 1, + "detection_accuracy": 0.5 + }, + "clock": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "cow": { + "gt_objects": 3, + "matched": 1, + "detection_accuracy": 0.3333333333333333 + }, + "cup": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "dining table": { + "gt_objects": 1, + "matched": 0, + "detection_accuracy": 0.0 + }, + "frisbee": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "giraffe": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "kite": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "laptop": { + "gt_objects": 6, + "matched": 3, + "detection_accuracy": 0.5 + }, + "microwave": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "scissors": { + "gt_objects": 2, + "matched": 1, + "detection_accuracy": 0.5 + }, + "skis": { + "gt_objects": 3, + "matched": 3, + "detection_accuracy": 1.0 + }, + "suitcase": { + "gt_objects": 1, + "matched": 0, + "detection_accuracy": 0.0 + }, + "surfboard": { + "gt_objects": 8, + "matched": 5, + "detection_accuracy": 0.625 + }, + "vase": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + } + } + }, + "Style": { + "overall": { + "gt_objects": 684, + "matched": 576, + "detection_accuracy": 0.8421052631578947 + }, + "per_class": { + "banana": { + "gt_objects": 4, + "matched": 3, + "detection_accuracy": 0.75 + }, + "baseball bat": { + "gt_objects": 19, + "matched": 15, + "detection_accuracy": 0.7894736842105263 + }, + "bed": { + "gt_objects": 32, + "matched": 28, + "detection_accuracy": 0.875 + }, + "bird": { + "gt_objects": 7, + "matched": 6, + "detection_accuracy": 0.8571428571428571 + }, + "book": { + "gt_objects": 10, + "matched": 10, + "detection_accuracy": 1.0 + }, + "bottle": { + "gt_objects": 8, + "matched": 6, + "detection_accuracy": 0.75 + }, + "car": { + "gt_objects": 43, + "matched": 43, + "detection_accuracy": 1.0 + }, + "cat": { + "gt_objects": 4, + "matched": 4, + "detection_accuracy": 1.0 + }, + "cell phone": { + "gt_objects": 67, + "matched": 41, + "detection_accuracy": 0.6119402985074627 + }, + "chair": { + "gt_objects": 41, + "matched": 41, + "detection_accuracy": 1.0 + }, + "couch": { + "gt_objects": 41, + "matched": 40, + "detection_accuracy": 0.975609756097561 + }, + "dog": { + "gt_objects": 15, + "matched": 7, + "detection_accuracy": 0.4666666666666667 + }, + "donut": { + "gt_objects": 6, + "matched": 1, + "detection_accuracy": 0.16666666666666666 + }, + "fork": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "hair drier": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "handbag": { + "gt_objects": 6, + "matched": 5, + "detection_accuracy": 0.8333333333333334 + }, + "horse": { + "gt_objects": 5, + "matched": 5, + "detection_accuracy": 1.0 + }, + "motorcycle": { + "gt_objects": 5, + "matched": 5, + "detection_accuracy": 1.0 + }, + "potted plant": { + "gt_objects": 7, + "matched": 7, + "detection_accuracy": 1.0 + }, + "refrigerator": { + "gt_objects": 6, + "matched": 5, + "detection_accuracy": 0.8333333333333334 + }, + "remote": { + "gt_objects": 3, + "matched": 3, + "detection_accuracy": 1.0 + }, + "skateboard": { + "gt_objects": 5, + "matched": 5, + "detection_accuracy": 1.0 + }, + "snowboard": { + "gt_objects": 2, + "matched": 1, + "detection_accuracy": 0.5 + }, + "sports ball": { + "gt_objects": 12, + "matched": 12, + "detection_accuracy": 1.0 + }, + "stop sign": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "teddy bear": { + "gt_objects": 8, + "matched": 7, + "detection_accuracy": 0.875 + }, + "tennis racket": { + "gt_objects": 20, + "matched": 20, + "detection_accuracy": 1.0 + }, + "tie": { + "gt_objects": 175, + "matched": 139, + "detection_accuracy": 0.7942857142857143 + }, + "toothbrush": { + "gt_objects": 20, + "matched": 15, + "detection_accuracy": 0.75 + }, + "truck": { + "gt_objects": 9, + "matched": 9, + "detection_accuracy": 1.0 + }, + "tv": { + "gt_objects": 22, + "matched": 19, + "detection_accuracy": 0.8636363636363636 + }, + "umbrella": { + "gt_objects": 16, + "matched": 16, + "detection_accuracy": 1.0 + }, + "wine glass": { + "gt_objects": 4, + "matched": 2, + "detection_accuracy": 0.5 + }, + "airplane": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "backpack": { + "gt_objects": 5, + "matched": 5, + "detection_accuracy": 1.0 + }, + "baseball glove": { + "gt_objects": 5, + "matched": 5, + "detection_accuracy": 1.0 + }, + "bench": { + "gt_objects": 4, + "matched": 4, + "detection_accuracy": 1.0 + }, + "boat": { + "gt_objects": 5, + "matched": 4, + "detection_accuracy": 0.8 + }, + "bowl": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "bus": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "cake": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "clock": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "cow": { + "gt_objects": 3, + "matched": 2, + "detection_accuracy": 0.6666666666666666 + }, + "cup": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "dining table": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "frisbee": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "giraffe": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "kite": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "laptop": { + "gt_objects": 6, + "matched": 5, + "detection_accuracy": 0.8333333333333334 + }, + "microwave": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "scissors": { + "gt_objects": 2, + "matched": 1, + "detection_accuracy": 0.5 + }, + "skis": { + "gt_objects": 3, + "matched": 2, + "detection_accuracy": 0.6666666666666666 + }, + "suitcase": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "surfboard": { + "gt_objects": 8, + "matched": 7, + "detection_accuracy": 0.875 + }, + "vase": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + } + } + }, + "Swap": { + "overall": { + "gt_objects": 684, + "matched": 602, + "detection_accuracy": 0.8801169590643275 + }, + "per_class": { + "banana": { + "gt_objects": 4, + "matched": 4, + "detection_accuracy": 1.0 + }, + "baseball bat": { + "gt_objects": 19, + "matched": 16, + "detection_accuracy": 0.8421052631578947 + }, + "bed": { + "gt_objects": 32, + "matched": 29, + "detection_accuracy": 0.90625 + }, + "bird": { + "gt_objects": 7, + "matched": 5, + "detection_accuracy": 0.7142857142857143 + }, + "book": { + "gt_objects": 10, + "matched": 10, + "detection_accuracy": 1.0 + }, + "bottle": { + "gt_objects": 8, + "matched": 8, + "detection_accuracy": 1.0 + }, + "car": { + "gt_objects": 43, + "matched": 43, + "detection_accuracy": 1.0 + }, + "cat": { + "gt_objects": 4, + "matched": 4, + "detection_accuracy": 1.0 + }, + "cell phone": { + "gt_objects": 67, + "matched": 52, + "detection_accuracy": 0.7761194029850746 + }, + "chair": { + "gt_objects": 41, + "matched": 37, + "detection_accuracy": 0.9024390243902439 + }, + "couch": { + "gt_objects": 41, + "matched": 41, + "detection_accuracy": 1.0 + }, + "dog": { + "gt_objects": 15, + "matched": 8, + "detection_accuracy": 0.5333333333333333 + }, + "donut": { + "gt_objects": 6, + "matched": 4, + "detection_accuracy": 0.6666666666666666 + }, + "fork": { + "gt_objects": 1, + "matched": 0, + "detection_accuracy": 0.0 + }, + "hair drier": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "handbag": { + "gt_objects": 6, + "matched": 6, + "detection_accuracy": 1.0 + }, + "horse": { + "gt_objects": 5, + "matched": 5, + "detection_accuracy": 1.0 + }, + "motorcycle": { + "gt_objects": 5, + "matched": 5, + "detection_accuracy": 1.0 + }, + "potted plant": { + "gt_objects": 7, + "matched": 7, + "detection_accuracy": 1.0 + }, + "refrigerator": { + "gt_objects": 6, + "matched": 5, + "detection_accuracy": 0.8333333333333334 + }, + "remote": { + "gt_objects": 3, + "matched": 3, + "detection_accuracy": 1.0 + }, + "skateboard": { + "gt_objects": 5, + "matched": 4, + "detection_accuracy": 0.8 + }, + "snowboard": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "sports ball": { + "gt_objects": 12, + "matched": 12, + "detection_accuracy": 1.0 + }, + "stop sign": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "teddy bear": { + "gt_objects": 8, + "matched": 7, + "detection_accuracy": 0.875 + }, + "tennis racket": { + "gt_objects": 20, + "matched": 20, + "detection_accuracy": 1.0 + }, + "tie": { + "gt_objects": 175, + "matched": 149, + "detection_accuracy": 0.8514285714285714 + }, + "toothbrush": { + "gt_objects": 20, + "matched": 11, + "detection_accuracy": 0.55 + }, + "truck": { + "gt_objects": 9, + "matched": 9, + "detection_accuracy": 1.0 + }, + "tv": { + "gt_objects": 22, + "matched": 20, + "detection_accuracy": 0.9090909090909091 + }, + "umbrella": { + "gt_objects": 16, + "matched": 16, + "detection_accuracy": 1.0 + }, + "wine glass": { + "gt_objects": 4, + "matched": 2, + "detection_accuracy": 0.5 + }, + "airplane": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "backpack": { + "gt_objects": 5, + "matched": 4, + "detection_accuracy": 0.8 + }, + "baseball glove": { + "gt_objects": 5, + "matched": 5, + "detection_accuracy": 1.0 + }, + "bench": { + "gt_objects": 4, + "matched": 4, + "detection_accuracy": 1.0 + }, + "boat": { + "gt_objects": 5, + "matched": 5, + "detection_accuracy": 1.0 + }, + "bowl": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "bus": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "cake": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "clock": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "cow": { + "gt_objects": 3, + "matched": 2, + "detection_accuracy": 0.6666666666666666 + }, + "cup": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "dining table": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "frisbee": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "giraffe": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "kite": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "laptop": { + "gt_objects": 6, + "matched": 6, + "detection_accuracy": 1.0 + }, + "microwave": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "scissors": { + "gt_objects": 2, + "matched": 1, + "detection_accuracy": 0.5 + }, + "skis": { + "gt_objects": 3, + "matched": 3, + "detection_accuracy": 1.0 + }, + "suitcase": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "surfboard": { + "gt_objects": 8, + "matched": 8, + "detection_accuracy": 1.0 + }, + "vase": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + } + } + }, + "Synthetic": { + "overall": { + "gt_objects": 684, + "matched": 582, + "detection_accuracy": 0.8508771929824561 + }, + "per_class": { + "banana": { + "gt_objects": 4, + "matched": 2, + "detection_accuracy": 0.5 + }, + "baseball bat": { + "gt_objects": 19, + "matched": 16, + "detection_accuracy": 0.8421052631578947 + }, + "bed": { + "gt_objects": 32, + "matched": 30, + "detection_accuracy": 0.9375 + }, + "bird": { + "gt_objects": 7, + "matched": 3, + "detection_accuracy": 0.42857142857142855 + }, + "book": { + "gt_objects": 10, + "matched": 9, + "detection_accuracy": 0.9 + }, + "bottle": { + "gt_objects": 8, + "matched": 7, + "detection_accuracy": 0.875 + }, + "car": { + "gt_objects": 43, + "matched": 43, + "detection_accuracy": 1.0 + }, + "cat": { + "gt_objects": 4, + "matched": 3, + "detection_accuracy": 0.75 + }, + "cell phone": { + "gt_objects": 67, + "matched": 47, + "detection_accuracy": 0.7014925373134329 + }, + "chair": { + "gt_objects": 41, + "matched": 38, + "detection_accuracy": 0.926829268292683 + }, + "couch": { + "gt_objects": 41, + "matched": 41, + "detection_accuracy": 1.0 + }, + "dog": { + "gt_objects": 15, + "matched": 8, + "detection_accuracy": 0.5333333333333333 + }, + "donut": { + "gt_objects": 6, + "matched": 1, + "detection_accuracy": 0.16666666666666666 + }, + "fork": { + "gt_objects": 1, + "matched": 0, + "detection_accuracy": 0.0 + }, + "hair drier": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "handbag": { + "gt_objects": 6, + "matched": 6, + "detection_accuracy": 1.0 + }, + "horse": { + "gt_objects": 5, + "matched": 5, + "detection_accuracy": 1.0 + }, + "motorcycle": { + "gt_objects": 5, + "matched": 5, + "detection_accuracy": 1.0 + }, + "potted plant": { + "gt_objects": 7, + "matched": 7, + "detection_accuracy": 1.0 + }, + "refrigerator": { + "gt_objects": 6, + "matched": 5, + "detection_accuracy": 0.8333333333333334 + }, + "remote": { + "gt_objects": 3, + "matched": 3, + "detection_accuracy": 1.0 + }, + "skateboard": { + "gt_objects": 5, + "matched": 4, + "detection_accuracy": 0.8 + }, + "snowboard": { + "gt_objects": 2, + "matched": 1, + "detection_accuracy": 0.5 + }, + "sports ball": { + "gt_objects": 12, + "matched": 11, + "detection_accuracy": 0.9166666666666666 + }, + "stop sign": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "teddy bear": { + "gt_objects": 8, + "matched": 7, + "detection_accuracy": 0.875 + }, + "tennis racket": { + "gt_objects": 20, + "matched": 19, + "detection_accuracy": 0.95 + }, + "tie": { + "gt_objects": 175, + "matched": 147, + "detection_accuracy": 0.84 + }, + "toothbrush": { + "gt_objects": 20, + "matched": 11, + "detection_accuracy": 0.55 + }, + "truck": { + "gt_objects": 9, + "matched": 9, + "detection_accuracy": 1.0 + }, + "tv": { + "gt_objects": 22, + "matched": 20, + "detection_accuracy": 0.9090909090909091 + }, + "umbrella": { + "gt_objects": 16, + "matched": 16, + "detection_accuracy": 1.0 + }, + "wine glass": { + "gt_objects": 4, + "matched": 4, + "detection_accuracy": 1.0 + }, + "airplane": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "backpack": { + "gt_objects": 5, + "matched": 5, + "detection_accuracy": 1.0 + }, + "baseball glove": { + "gt_objects": 5, + "matched": 3, + "detection_accuracy": 0.6 + }, + "bench": { + "gt_objects": 4, + "matched": 4, + "detection_accuracy": 1.0 + }, + "boat": { + "gt_objects": 5, + "matched": 5, + "detection_accuracy": 1.0 + }, + "bowl": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "bus": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "cake": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "clock": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "cow": { + "gt_objects": 3, + "matched": 1, + "detection_accuracy": 0.3333333333333333 + }, + "cup": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "dining table": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "frisbee": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "giraffe": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "kite": { + "gt_objects": 2, + "matched": 2, + "detection_accuracy": 1.0 + }, + "laptop": { + "gt_objects": 6, + "matched": 5, + "detection_accuracy": 0.8333333333333334 + }, + "microwave": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "scissors": { + "gt_objects": 2, + "matched": 1, + "detection_accuracy": 0.5 + }, + "skis": { + "gt_objects": 3, + "matched": 3, + "detection_accuracy": 1.0 + }, + "suitcase": { + "gt_objects": 1, + "matched": 1, + "detection_accuracy": 1.0 + }, + "surfboard": { + "gt_objects": 8, + "matched": 8, + "detection_accuracy": 1.0 + }, + "vase": { + "gt_objects": 1, + "matched": 0, + "detection_accuracy": 0.0 + } + } + } +} \ No newline at end of file