From 59ffd101f1a16ff558e192cffa9079fc5c831002 Mon Sep 17 00:00:00 2001 From: Till Raab Date: Mon, 4 Dec 2023 08:50:53 +0100 Subject: [PATCH] when labels are gererated for an already existing dataset delete the file_dict.csv file used by corret_bboxes --- inference.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/inference.py b/inference.py index b9d29fd..9615779 100644 --- a/inference.py +++ b/inference.py @@ -24,7 +24,7 @@ def plot_inference(img_tensor, img_name, output, detection_threshold, dataset_na gs = gridspec.GridSpec(1, 1, bottom=0, left=0, right=1, top=1) # ax = fig.add_subplot(gs[0, 0]) - ax.imshow(img_tensor.cpu().squeeze().permute(1, 2, 0), aspect='auto') + ax.imshow(img_tensor.cpu().squeeze().permute(1, 2, 0), aspect='auto', cmap='afmhot') for (x0, y0, x1, y1), l, score in zip(output['boxes'].cpu(), output['labels'].cpu(), output['scores'].cpu()): if score < detection_threshold: continue @@ -34,7 +34,7 @@ def plot_inference(img_tensor, img_name, output, detection_threshold, dataset_na Rectangle((x0, y0), (x1 - x0), (y1 - y0), - fill=False, color="tab:green", linestyle='--', linewidth=2, zorder=10) + fill=False, color="tab:gray", linestyle='-', linewidth=2, zorder=10) ) ax.set_axis_off() @@ -98,6 +98,11 @@ def main(args): infere_model(inference_loader, model, dataset_name) + if (Path('data').absolute() / dataset_name / 'file_dict.csv').exists(): + (Path('data').absolute() / dataset_name / 'file_dict.csv').unlink() + + + # detection_threshold = 0.8 # frame_count = 0 # total_fps = 0