Spaces:
Runtime error
Runtime error
Commit
·
f639061
1
Parent(s):
73afcbb
track_eval
Browse files- scripts/track_detection.py +3 -2
- scripts/track_eval.py +5 -4
scripts/track_detection.py
CHANGED
@@ -45,7 +45,7 @@ def main(args, config={}, verbose=True):
|
|
45 |
for loc in locations:
|
46 |
|
47 |
in_loc_dir = os.path.join(args.detections, loc)
|
48 |
-
out_loc_dir = os.path.join(args.output, loc,
|
49 |
os.makedirs(out_loc_dir, exist_ok=True)
|
50 |
metadata_path = os.path.join(args.metadata, loc + ".json")
|
51 |
print(in_loc_dir)
|
@@ -101,7 +101,7 @@ def track(in_loc_dir, out_loc_dir, metadata_path, seq, config, verbose):
|
|
101 |
outputs = do_suppression(inference, conf_thres=config['conf_threshold'], iou_thres=config['nms_iou'], verbose=verbose)
|
102 |
|
103 |
if config['use_associative']:
|
104 |
-
|
105 |
do_confidence_boost(inference, outputs, verbose=verbose)
|
106 |
|
107 |
outputs = do_suppression(inference, conf_thres=config['conf_threshold'], iou_thres=config['nms_iou'], verbose=verbose)
|
@@ -142,6 +142,7 @@ def argument_parser():
|
|
142 |
parser.add_argument("--detections", required=True, help="Path to frame directory. Required.")
|
143 |
parser.add_argument("--output", required=True, help="Path to output directory. Required.")
|
144 |
parser.add_argument("--metadata", required=True, help="Path to output directory. Required.")
|
|
|
145 |
return parser
|
146 |
|
147 |
if __name__ == "__main__":
|
|
|
45 |
for loc in locations:
|
46 |
|
47 |
in_loc_dir = os.path.join(args.detections, loc)
|
48 |
+
out_loc_dir = os.path.join(args.output, loc, args.tracker, "data")
|
49 |
os.makedirs(out_loc_dir, exist_ok=True)
|
50 |
metadata_path = os.path.join(args.metadata, loc + ".json")
|
51 |
print(in_loc_dir)
|
|
|
101 |
outputs = do_suppression(inference, conf_thres=config['conf_threshold'], iou_thres=config['nms_iou'], verbose=verbose)
|
102 |
|
103 |
if config['use_associative']:
|
104 |
+
|
105 |
do_confidence_boost(inference, outputs, verbose=verbose)
|
106 |
|
107 |
outputs = do_suppression(inference, conf_thres=config['conf_threshold'], iou_thres=config['nms_iou'], verbose=verbose)
|
|
|
142 |
parser.add_argument("--detections", required=True, help="Path to frame directory. Required.")
|
143 |
parser.add_argument("--output", required=True, help="Path to output directory. Required.")
|
144 |
parser.add_argument("--metadata", required=True, help="Path to output directory. Required.")
|
145 |
+
parser.add_argument("--tracker", default='tracker', help="Path to output directory. Required.")
|
146 |
return parser
|
147 |
|
148 |
if __name__ == "__main__":
|
scripts/track_eval.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import project_path
|
2 |
import argparse
|
3 |
-
from
|
4 |
import sys
|
5 |
sys.path.append('..')
|
6 |
sys.path.append('../caltech-fish-counting')
|
@@ -15,8 +15,9 @@ def main(args):
|
|
15 |
infer_args = Object()
|
16 |
infer_args.metadata = "../frames/metadata"
|
17 |
infer_args.frames = "../frames/images"
|
18 |
-
infer_args.output = "../frames/
|
19 |
infer_args.weights = "models/v5m_896_300best.pt"
|
|
|
20 |
|
21 |
config = {
|
22 |
'conf_threshold': float(args.conf_threshold),
|
@@ -27,9 +28,9 @@ def main(args):
|
|
27 |
'min_hits': int(args.min_hits)
|
28 |
}
|
29 |
|
30 |
-
|
31 |
|
32 |
-
evaluate(
|
33 |
|
34 |
|
35 |
def argument_parser():
|
|
|
1 |
import project_path
|
2 |
import argparse
|
3 |
+
from track_detection import main as track
|
4 |
import sys
|
5 |
sys.path.append('..')
|
6 |
sys.path.append('../caltech-fish-counting')
|
|
|
15 |
infer_args = Object()
|
16 |
infer_args.metadata = "../frames/metadata"
|
17 |
infer_args.frames = "../frames/images"
|
18 |
+
infer_args.output = "../frames/result_testing"
|
19 |
infer_args.weights = "models/v5m_896_300best.pt"
|
20 |
+
infer_args.tracker = 'tracker'
|
21 |
|
22 |
config = {
|
23 |
'conf_threshold': float(args.conf_threshold),
|
|
|
28 |
'min_hits': int(args.min_hits)
|
29 |
}
|
30 |
|
31 |
+
track(infer_args, config=config, verbose=False)
|
32 |
|
33 |
+
evaluate(infer_args.output, "../frames/MOT", "../frames/metadata", infer_args.tracker, False)
|
34 |
|
35 |
|
36 |
def argument_parser():
|