clean_str() function addition (#1674)

* clean_str() function addition

* cleanup

* add euro symbol €

* add closing exclamation (spanish)

* cleanup
This commit is contained in:
Glenn Jocher authored and GitHub committed 2020-12-17 17:20:20 -08:00
1 parent 7e161d9774
commit d5289b54c4
3 files changed
+13 -7

No files matched your search

+5 -4
View File
@@ -81,12 +81,13 @@ def detect(save_img=False):
# Process detections
for i, det in enumerate(pred): # detections per image
if webcam: # batch_size >= 1
p, s, im0, frame = Path(path[i]), '%g: ' % i, im0s[i].copy(), dataset.count
p, s, im0, frame = path[i], '%g: ' % i, im0s[i].copy(), dataset.count
else:
p, s, im0, frame = Path(path), '', im0s, getattr(dataset, 'frame', 0)
p, s, im0, frame = path, '', im0s, getattr(dataset, 'frame', 0)
save_path = str(save_dir / p.name)
txt_path = str(save_dir / 'labels' / p.stem) + ('' if dataset.mode == 'image' else f'_{frame}')
p = Path(p) # to Path
save_path = str(save_dir / p.name) # img.jpg
txt_path = str(save_dir / 'labels' / p.stem) + ('' if dataset.mode == 'image' else f'_{frame}') # img.txt
s += '%gx%g ' % img.shape[2:] # print string
gn = torch.tensor(im0.shape)[[1, 0, 1, 0]] # normalization gain whwh
if len(det):