class labeling corrections
This commit is contained in:
parent
ebd682b25c
commit
1ca352b328
|
@ -37,7 +37,7 @@ def detect(
|
||||||
model.to(device).eval()
|
model.to(device).eval()
|
||||||
|
|
||||||
# Set Dataloader
|
# Set Dataloader
|
||||||
dataloader = load_images(images, img_size=img_size)
|
dataloader = LoadImages(images, img_size=img_size)
|
||||||
|
|
||||||
# Get classes and colors
|
# Get classes and colors
|
||||||
classes = load_classes(parse_data_cfg('cfg/coco.data')['names'])
|
classes = load_classes(parse_data_cfg('cfg/coco.data')['names'])
|
||||||
|
|
4
test.py
4
test.py
|
@ -36,8 +36,8 @@ def test(
|
||||||
model.to(device).eval()
|
model.to(device).eval()
|
||||||
|
|
||||||
# Get dataloader
|
# Get dataloader
|
||||||
# dataloader = torch.utils.data.DataLoader(load_images_with_labels(test_path), batch_size=batch_size) # pytorch
|
# dataloader = torch.utils.data.DataLoader(LoadImagesAndLabels(test_path), batch_size=batch_size) # pytorch
|
||||||
dataloader = load_images_and_labels(test_path, batch_size=batch_size, img_size=img_size)
|
dataloader = LoadImagesAndLabels(test_path, batch_size=batch_size, img_size=img_size)
|
||||||
|
|
||||||
mean_mAP, mean_R, mean_P = 0.0, 0.0, 0.0
|
mean_mAP, mean_R, mean_P = 0.0, 0.0, 0.0
|
||||||
print('%11s' * 5 % ('Image', 'Total', 'P', 'R', 'mAP'))
|
print('%11s' * 5 % ('Image', 'Total', 'P', 'R', 'mAP'))
|
||||||
|
|
2
train.py
2
train.py
|
@ -43,7 +43,7 @@ def train(
|
||||||
model = Darknet(cfg, img_size)
|
model = Darknet(cfg, img_size)
|
||||||
|
|
||||||
# Get dataloader
|
# 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
|
lr0 = 0.001
|
||||||
if resume:
|
if resume:
|
||||||
|
|
|
@ -12,7 +12,7 @@ import torch
|
||||||
from utils.utils import xyxy2xywh
|
from utils.utils import xyxy2xywh
|
||||||
|
|
||||||
|
|
||||||
class load_images(): # for inference
|
class LoadImages: # for inference
|
||||||
def __init__(self, path, img_size=416):
|
def __init__(self, path, img_size=416):
|
||||||
if os.path.isdir(path):
|
if os.path.isdir(path):
|
||||||
image_format = ['.jpg', '.jpeg', '.png', '.tif']
|
image_format = ['.jpg', '.jpeg', '.png', '.tif']
|
||||||
|
@ -55,7 +55,7 @@ class load_images(): # for inference
|
||||||
return self.nF # number of files
|
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):
|
def __init__(self, path, batch_size=1, img_size=608, multi_scale=False, augment=False):
|
||||||
self.path = path
|
self.path = path
|
||||||
with open(path, 'r') as file:
|
with open(path, 'r') as file:
|
||||||
|
|
Loading…
Reference in New Issue