pytorch-yolo-v3
pytorch-yolo-v3 copied to clipboard
Issue with printing on windows
Hey I ran the detect.py script on windows machine and no images were being output. I found the error, it's on line 302 of detect.py:
det_names = pd.Series(imlist).apply(lambda x: "{}/det_{}".format(args.det,x.split("/")[-1]))
This works for linux and mac machines but not on windows, it's an easy fix though. I tried to push a PR but didnt realize I couldnt. The fix is simple, add import platform to the top of detect.py and change line 302 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]))```
Thanks this helps. I have forked the code and updated it with your suggestion. I had to import the "platform" module.
If you are on Windows platform use the following detect.py instead of the one come here
https://github.com/RanchMobile/pytorch-yolo-v3/blob/master/detect.py
place the above file in the root folder or where detect.py is.
@yuskey Yes!thx for fix this problem!
@justein @RanchMobile @yuskey The https://github.com/ultralytics/yolov3 repo works on MacOS, Windows and Linux, includes multigpu and multithreading, performs rectangular inference including batch_norm2d fusion on images, videos, webcams, and an iOS app. It also tests to slightly higher mAPs than darknet, including on the latest YOLOv3-SPP.weights (60.7 COCO mAP), and offers the ability to train custom datasets from scratch to darknet performance, all using PyTorch :)

@fourth-archive thanks to provide the awesome product! I will learn it now
@yuskey Yes!thx for fix this problem!
Can I please ask if the images are saved into another folder if you run the detect.py on a directory containing many images? I can run and get the output image on a single image instead of a directory in the Windows system.