This commit is contained in:
Glenn Jocher
2018-12-03 21:08:45 +01:00
parent dc704edf17
commit 10cca39934
4 changed files with 6 additions and 14 deletions
+2 -7
View File
@@ -66,12 +66,7 @@ class load_images_and_labels(): # for training
with open(path, 'r') as file:
self.img_files = file.readlines()
if platform == 'darwin': # MacOS (local)
self.img_files = [path.replace('\n', '').replace('/images', '/Users/glennjocher/Downloads/data/coco/images')
for path in self.img_files]
else: # linux (gcp cloud)
self.img_files = [path.replace('\n', '').replace('/images', '../coco/images') for path in self.img_files]
self.img_files = [path.replace('\n', '') for path in self.img_files]
self.label_files = [path.replace('images', 'labels').replace('.png', '.txt').replace('.jpg', '.txt') for path in
self.img_files]
@@ -287,7 +282,7 @@ def random_affine(img, targets=None, degrees=(-10, 10), translate=(.1, .1), scal
return imw
def convert_tif2bmp(p='/Users/glennjocher/Downloads/DATA/xview/val_images_bmp'):
def convert_tif2bmp(p='../xview/val_images_bmp'):
import glob
import cv2
files = sorted(glob.glob('%s/*.tif' % p))
+1 -1
View File
@@ -424,7 +424,7 @@ def strip_optimizer_from_checkpoint(filename='weights/best.pt'):
torch.save(a, filename.replace('.pt', '_lite.pt'))
def coco_class_count(path='/Users/glennjocher/downloads/DATA/coco/labels/train2014/'):
def coco_class_count(path='../coco/labels/train2014/'):
import glob
nC = 80 # number classes