This commit is contained in:
Glenn Jocher 2019-04-02 16:06:15 +02:00
parent 3f82380e12
commit 3c233bc0b7
5 changed files with 17 additions and 15 deletions

16
.gitignore vendored
View File

@ -8,17 +8,25 @@
*.PNG
*.TIF
*.HEIC
*.mp4
*.mov
*.MOV
*.avi
*.data
*.cfg
*.json
data/*
pycocotools/*
!cfg/coco.data
*.cfg
!cfg/yolov3*.cfg
data/*
!data/samples/zidane.jpg
!data/coco.names
!data/coco_paper.names
!data/coco.data
!data/coco_1cls.data
!data/coco_1img.data
pycocotools/*
results*.txt
# MATLAB GitIgnore -----------------------------------------------------------------------------------------------------

View File

@ -1,6 +0,0 @@
classes=80
train=../coco/trainvalno5k.txt
valid=../coco/5k.txt
names=data/coco.names
backup=backup/
eval=coco

View File

@ -106,7 +106,7 @@ def detect(
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--cfg', type=str, default='cfg/yolov3.cfg', help='cfg file path')
parser.add_argument('--data-cfg', type=str, default='cfg/coco.data', help='coco.data file path')
parser.add_argument('--data-cfg', type=str, default='data/coco.data', help='coco.data file path')
parser.add_argument('--weights', type=str, default='weights/yolov3.weights', help='path to weights file')
parser.add_argument('--images', type=str, default='data/samples', help='path to images')
parser.add_argument('--img-size', type=int, default=32 * 13, help='size of each image dimension')

View File

@ -165,7 +165,7 @@ if __name__ == '__main__':
parser = argparse.ArgumentParser(prog='test.py')
parser.add_argument('--batch-size', type=int, default=32, help='size of each image batch')
parser.add_argument('--cfg', type=str, default='cfg/yolov3.cfg', help='cfg file path')
parser.add_argument('--data-cfg', type=str, default='cfg/example_single_class.data', help='coco.data file path')
parser.add_argument('--data-cfg', type=str, default='data/coco.data', help='coco.data file path')
parser.add_argument('--weights', type=str, default='weights/latesth.pt', help='path to weights file')
parser.add_argument('--iou-thres', type=float, default=0.5, help='iou threshold required to qualify as detected')
parser.add_argument('--conf-thres', type=float, default=0.001, help='object confidence threshold')

View File

@ -62,8 +62,8 @@ def train(
cutoff = load_darknet_weights(model, weights + 'yolov3-tiny.conv.15')
# Transfer learning (train only YOLO layers)
# for i, (name, p) in enumerate(model.named_parameters()):
# p.requires_grad = True if (p.shape[0] == 255) else False
# for (name, p) in model.named_parameters():
# p.requires_grad = True if p.shape[0] == 255 else False
# Set scheduler (reduce lr at epoch 250)
scheduler = torch.optim.lr_scheduler.MultiStepLR(optimizer, milestones=[250], gamma=0.1, last_epoch=start_epoch - 1)
@ -205,7 +205,7 @@ if __name__ == '__main__':
parser.add_argument('--batch-size', type=int, default=16, help='size of each image batch')
parser.add_argument('--accumulate', type=int, default=1, help='accumulate gradient x batches before optimizing')
parser.add_argument('--cfg', type=str, default='cfg/yolov3.cfg', help='cfg file path')
parser.add_argument('--data-cfg', type=str, default='cfg/coco.data', help='coco.data file path')
parser.add_argument('--data-cfg', type=str, default='data/coco.data', help='coco.data file path')
parser.add_argument('--multi-scale', action='store_true', help='random image sizes per batch 320 - 608')
parser.add_argument('--img-size', type=int, default=32 * 13, help='pixels')
parser.add_argument('--resume', action='store_true', help='resume training flag')