From 2fc7c0a7314eef0bead4ef8981664cad6dbbb141 Mon Sep 17 00:00:00 2001 From: yptheangel Date: Mon, 2 Mar 2020 00:39:32 +0800 Subject: [PATCH] update concatenation method so that the voc-to-yolov3 converter can support linux environment --- voc_to_YOLOv3.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/voc_to_YOLOv3.py b/voc_to_YOLOv3.py index d17592d..eb89ff3 100644 --- a/voc_to_YOLOv3.py +++ b/voc_to_YOLOv3.py @@ -3,13 +3,13 @@ import os -dataset_train = 'OID\\Dataset\\train\\' +dataset_train = os.path.join("OID","Dataset","train") dataset_file = '4_CLASS_test.txt' classes_file = dataset_file[:-4]+'_classes.txt' CLS = os.listdir(dataset_train) -classes =[dataset_train+CLASS for CLASS in CLS] +classes =[os.path.join(dataset_train,CLASS) for CLASS in CLS] wd = getcwd() @@ -48,7 +48,7 @@ def test(fullname): for filename in os.listdir(CLASS): if not filename.endswith('.xml'): continue - fullname = os.getcwd()+'\\'+CLASS+'\\'+filename + fullname = os.path.join(os.getcwd(),CLASS,filename) test(fullname) for CLASS in CLS: