class labeling corrections

This commit is contained in:
Glenn Jocher 2019-02-11 12:44:12 +01:00
parent ebd682b25c
commit 1ca352b328
4 changed files with 6 additions and 6 deletions

View File

@ -37,7 +37,7 @@ def detect(
model.to(device).eval()
# Set Dataloader
dataloader = load_images(images, img_size=img_size)
dataloader = LoadImages(images, img_size=img_size)
# Get classes and colors
classes = load_classes(parse_data_cfg('cfg/coco.data')['names'])

View File

@ -36,8 +36,8 @@ def test(
model.to(device).eval()
# Get dataloader
# dataloader = torch.utils.data.DataLoader(load_images_with_labels(test_path), batch_size=batch_size) # pytorch
dataloader = load_images_and_labels(test_path, batch_size=batch_size, img_size=img_size)
# dataloader = torch.utils.data.DataLoader(LoadImagesAndLabels(test_path), batch_size=batch_size) # pytorch
dataloader = LoadImagesAndLabels(test_path, batch_size=batch_size, img_size=img_size)
mean_mAP, mean_R, mean_P = 0.0, 0.0, 0.0
print('%11s' * 5 % ('Image', 'Total', 'P', 'R', 'mAP'))

View File

@ -43,7 +43,7 @@ def train(
model = Darknet(cfg, img_size)
# Get dataloader
dataloader = load_images_and_labels(train_path, batch_size, img_size, multi_scale=multi_scale, augment=True)
dataloader = LoadImagesAndLabels(train_path, batch_size, img_size, multi_scale=multi_scale, augment=True)
lr0 = 0.001
if resume:

View File

@ -12,7 +12,7 @@ import torch
from utils.utils import xyxy2xywh
class load_images(): # for inference
class LoadImages: # for inference
def __init__(self, path, img_size=416):
if os.path.isdir(path):
image_format = ['.jpg', '.jpeg', '.png', '.tif']
@ -55,7 +55,7 @@ class load_images(): # for inference
return self.nF # number of files
class load_images_and_labels(): # for training
class LoadImagesAndLabels: # for training
def __init__(self, path, batch_size=1, img_size=608, multi_scale=False, augment=False):
self.path = path
with open(path, 'r') as file: