Commit Graph
1 Commits
Author SHA1 Message Date
Johan Bergman 064365d868 Update parse_opt() in export.py to work as in train.py (#10789)
Update parse_opt() to work as in train.py

Change parse_opt() be able to use parse_known_args(), same as in train.py, so export.main() can be called from other script without error.

e.g.:

    from yolov5 import export
    opt = export.parse_opt(True)
    opt.weights = <model_path>
    opt.include = ("torchscript", "onnx")
    opt.data = <data>
    opt.imgsz = [<height>, <width>]
    export.main(opt)



Signed-off-by: Johan Bergman <35481994+duran67@users.noreply.github.com>

Signed-off-by: Johan Bergman <35481994+duran67@users.noreply.github.com>
2023-01-20 23:49:43 +01:00