oskarastrom commited on
Commit
253de9c
·
1 Parent(s): 77f857d

Update track_detection.py

Browse files
Files changed (1) hide show
  1. scripts/track_detection.py +3 -6
scripts/track_detection.py CHANGED
@@ -79,12 +79,9 @@ def track(in_loc_dir, out_loc_dir, metadata_path, seq, config, verbose):
79
  out_path = os.path.join(out_loc_dir, seq + ".txt")
80
 
81
 
82
- if torch.cuda.is_available():
83
- device_name = 'cuda:0'
84
- device = torch.device(device_name)
85
- inference = torch.load(inference_path, map_location=device)
86
- else:
87
- inference = torch.load(inference_path)
88
 
89
  # read detection
90
  with open(json_path, 'r') as f:
 
79
  out_path = os.path.join(out_loc_dir, seq + ".txt")
80
 
81
 
82
+ device_name = 'cuda:0' if torch.cuda.is_available() else 'cpu'
83
+ device = torch.device(device_name)
84
+ inference = torch.load(inference_path, map_location=device)
 
 
 
85
 
86
  # read detection
87
  with open(json_path, 'r') as f: