This commit is contained in:
Glenn Jocher 2018-08-26 11:52:27 +02:00
parent 184db1fb10
commit b965b6e9b7
1 changed files with 6 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import glob
import math import math
import os import os
import random import random
from sys import platform
import cv2 import cv2
import numpy as np import numpy as np
@ -63,7 +64,11 @@ class ListDataset(): # for training
#self.img_files = sorted(glob.glob('%s/*.*' % path)) #self.img_files = sorted(glob.glob('%s/*.*' % path))
with open(path, 'r') as file: with open(path, 'r') as file:
self.img_files = file.readlines() self.img_files = file.readlines()
if platform == 'darwin': # macos
self.img_files = [path.replace('\n', '').replace('/images','/Users/glennjocher/Downloads/DATA/coco/images') for path in self.img_files] self.img_files = [path.replace('\n', '').replace('/images','/Users/glennjocher/Downloads/DATA/coco/images') for path in self.img_files]
else:
self.img_files = [path.replace('\n', '').replace('/images','../coco/images') for path in self.img_files]
self.label_files = [path.replace('images', 'labels').replace('.png', '.txt').replace('.jpg', '.txt') for path in self.label_files = [path.replace('images', 'labels').replace('.png', '.txt').replace('.jpg', '.txt') for path in
self.img_files] self.img_files]