From 7d5878872cc3902023e550f8b97a062d7717c9f1 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 12 Feb 2019 17:56:24 +0100 Subject: [PATCH] updates --- detect.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/detect.py b/detect.py index 65d8ffa5..985bb6a5 100644 --- a/detect.py +++ b/detect.py @@ -1,4 +1,5 @@ import shutil +from pathlib import Path import argparse import time from sys import platform @@ -54,7 +55,7 @@ def detect( print('webcam frame %g: ' % (i + 1), end='') else: print('image %g/%g %s: ' % (i + 1, len(dataloader), path), end='') - save_path = os.path.join(output, path.split('/')[-1]) + save_path = str(Path(output) / Path(path).name) # Get detections img = torch.from_numpy(img).unsqueeze(0).to(device)