Spaces:
Runtime error
Runtime error
Commit
·
38ce66e
1
Parent(s):
9bcdb1d
Final fix?
Browse files- inference.py +0 -1
- lib/fish_eye/tracker.py +1 -4
- scripts/track_detection.py +1 -9
inference.py
CHANGED
@@ -324,7 +324,6 @@ def do_tracking(all_preds, image_meter_width, image_meter_height, gp=None, max_a
|
|
324 |
|
325 |
json_data = tracker.finalize(min_length=min_length)
|
326 |
|
327 |
-
print(json_data)
|
328 |
return json_data
|
329 |
|
330 |
|
|
|
324 |
|
325 |
json_data = tracker.finalize(min_length=min_length)
|
326 |
|
|
|
327 |
return json_data
|
328 |
|
329 |
|
lib/fish_eye/tracker.py
CHANGED
@@ -109,10 +109,9 @@ class Tracker:
|
|
109 |
|
110 |
json_data['fish'].append(fish_entry)
|
111 |
|
112 |
-
|
113 |
# filter 'fish' field by fish length
|
114 |
json_data = Fish_Length.add_lengths(json_data)
|
115 |
-
print(json_data['fish'])
|
116 |
invalid_ids = []
|
117 |
if min_length != -1.0:
|
118 |
new_fish = []
|
@@ -123,8 +122,6 @@ class Tracker:
|
|
123 |
invalid_ids.append(fish['id'])
|
124 |
json_data['fish'] = new_fish
|
125 |
|
126 |
-
print(new_fish)
|
127 |
-
|
128 |
# filter 'frames' field by fish length
|
129 |
if len(invalid_ids):
|
130 |
for frame in json_data['frames']:
|
|
|
109 |
|
110 |
json_data['fish'].append(fish_entry)
|
111 |
|
112 |
+
|
113 |
# filter 'fish' field by fish length
|
114 |
json_data = Fish_Length.add_lengths(json_data)
|
|
|
115 |
invalid_ids = []
|
116 |
if min_length != -1.0:
|
117 |
new_fish = []
|
|
|
122 |
invalid_ids.append(fish['id'])
|
123 |
json_data['fish'] = new_fish
|
124 |
|
|
|
|
|
125 |
# filter 'frames' field by fish length
|
126 |
if len(invalid_ids):
|
127 |
for frame in json_data['frames']:
|
scripts/track_detection.py
CHANGED
@@ -81,10 +81,6 @@ def track(in_loc_dir, out_loc_dir, metadata_path, seq, config, verbose):
|
|
81 |
device = select_device(device_name, batch_size=32)
|
82 |
inference = torch.load(inference_path, map_location=device)
|
83 |
|
84 |
-
print(type(inference))
|
85 |
-
print(type(inference[0]))
|
86 |
-
print(inference[0].shape)
|
87 |
-
|
88 |
# read detection
|
89 |
with open(json_path, 'r') as f:
|
90 |
detection = json.load(f)
|
@@ -100,10 +96,7 @@ def track(in_loc_dir, out_loc_dir, metadata_path, seq, config, verbose):
|
|
100 |
for sequence in json_object:
|
101 |
if sequence['clip_name'] == seq:
|
102 |
image_meter_width = sequence['x_meter_stop'] - sequence['x_meter_start']
|
103 |
-
image_meter_height = sequence['
|
104 |
-
|
105 |
-
print(metadata_path)
|
106 |
-
print(image_meter_height)
|
107 |
|
108 |
outputs = do_suppression(inference, conf_thres=config['conf_threshold'], iou_thres=config['nms_iou'], verbose=verbose)
|
109 |
|
@@ -116,7 +109,6 @@ def track(in_loc_dir, out_loc_dir, metadata_path, seq, config, verbose):
|
|
116 |
|
117 |
results = do_tracking(all_preds, image_meter_width, image_meter_height, min_length=config['min_length'], max_age=config['max_age'], iou_thres=config['iou_threshold'], min_hits=config['min_hits'], verbose=verbose)
|
118 |
|
119 |
-
print(results)
|
120 |
mot_rows = []
|
121 |
for frame in results['frames']:
|
122 |
for fish in frame['fish']:
|
|
|
81 |
device = select_device(device_name, batch_size=32)
|
82 |
inference = torch.load(inference_path, map_location=device)
|
83 |
|
|
|
|
|
|
|
|
|
84 |
# read detection
|
85 |
with open(json_path, 'r') as f:
|
86 |
detection = json.load(f)
|
|
|
96 |
for sequence in json_object:
|
97 |
if sequence['clip_name'] == seq:
|
98 |
image_meter_width = sequence['x_meter_stop'] - sequence['x_meter_start']
|
99 |
+
image_meter_height = sequence['y_meter_start'] - sequence['y_meter_stop']
|
|
|
|
|
|
|
100 |
|
101 |
outputs = do_suppression(inference, conf_thres=config['conf_threshold'], iou_thres=config['nms_iou'], verbose=verbose)
|
102 |
|
|
|
109 |
|
110 |
results = do_tracking(all_preds, image_meter_width, image_meter_height, min_length=config['min_length'], max_age=config['max_age'], iou_thres=config['iou_threshold'], min_hits=config['min_hits'], verbose=verbose)
|
111 |
|
|
|
112 |
mot_rows = []
|
113 |
for frame in results['frames']:
|
114 |
for fish in frame['fish']:
|