This commit is contained in:
Glenn Jocher 2020-01-30 12:37:47 -08:00
parent ff7ee7f1f1
commit 27c75b5210
1 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,7 @@ def detect(save_img=False):
if ONNX_EXPORT: if ONNX_EXPORT:
model.fuse() model.fuse()
img = torch.zeros((1, 3) + img_size) # (1, 3, 320, 192) img = torch.zeros((1, 3) + img_size) # (1, 3, 320, 192)
torch.onnx.export(model, img, 'weights/export.onnx', verbose=False, opset_version=11) torch.onnx.export(model, img, 'weights/export.onnx', verbose=False, opset_version=10)
# Validate exported model # Validate exported model
import onnx import onnx
@ -159,7 +159,7 @@ if __name__ == '__main__':
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('--cfg', type=str, default='cfg/yolov3-spp.cfg', help='*.cfg path') parser.add_argument('--cfg', type=str, default='cfg/yolov3-spp.cfg', help='*.cfg path')
parser.add_argument('--names', type=str, default='data/coco.names', help='*.names path') parser.add_argument('--names', type=str, default='data/coco.names', help='*.names path')
parser.add_argument('--weights', type=str, default='weights/yolov3-spp.weights', help='path to weights file') parser.add_argument('--weights', type=str, default='weights/ultralytics68.pt', help='path to weights file')
parser.add_argument('--source', type=str, default='data/samples', help='source') # input file/folder, 0 for webcam parser.add_argument('--source', type=str, default='data/samples', help='source') # input file/folder, 0 for webcam
parser.add_argument('--output', type=str, default='output', help='output folder') # output folder parser.add_argument('--output', type=str, default='output', help='output folder') # output folder
parser.add_argument('--img-size', type=int, default=416, help='inference size (pixels)') parser.add_argument('--img-size', type=int, default=416, help='inference size (pixels)')