pytorch-yolo-v3 icon indicating copy to clipboard operation
pytorch-yolo-v3 copied to clipboard

Fix a bug on Windows when saving an output img.

Open liuslnlp opened this issue 6 years ago • 0 comments

The separator in Windows is "\" and in Linux is "/", so this line will be invalid on Win system

det_names = pd.Series(imlist).apply(lambda x: "{}/det_{}".format(args.det,x.split("/")[-1]))

and I modified it to

if platform.system() == 'Windows':
        det_names = pd.Series(imlist).apply(lambda x: "{}\\det_{}".format(args.det,x.split("\\")[-1]))
    else:
        det_names = pd.Series(imlist).apply(lambda x: "{}/det_{}".format(args.det,x.split("/")[-1]))

liuslnlp avatar Jan 13 '19 08:01 liuslnlp