Yolov5: can load the trained model in CPU ( using opencv ) ?

Created on 23 Jun 2020  路  8Comments  路  Source: ultralytics/yolov5

馃殌 Feature

how to load the trained model via a cpu and do inference?

Motivation

Loading the model in a CPU and do inference probably using opencv or using other methods

Pitch

Alternatives

Additional context

enhancement

All 8 comments

Hello @vishnukv64, thank you for your interest in our work! Please visit our Custom Training Tutorial to get started, and see our Jupyter Notebook Open In Colab, Docker Image, and Google Cloud Quickstart Guide for example environments.

If this is a bug report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom model or data training question, please note that Ultralytics does not provide free personal support. As a leader in vision ML and AI, we do offer professional consulting, from simple expert advice up to delivery of fully customized, end-to-end production solutions for our clients, such as:

  • Cloud-based AI systems operating on hundreds of HD video streams in realtime.
  • Edge AI integrated into custom iOS and Android apps for realtime 30 FPS video inference.
  • Custom data training, hyperparameter evolution, and model exportation to any destination.

For more information please visit https://www.ultralytics.com.

@vishnukv64 cpu loading is the default action currently if no gpu is detected on your system:

(env1) glennjocher@Glenns-MBP yolov5 % python detect.py
Namespace(agnostic_nms=False, augment=False, classes=None, conf_thres=0.4, device='', fourcc='mp4v', img_size=640, iou_thres=0.5, output='inference/output', save_txt=False, source='inference/images', view_img=False, weights='weights/yolov5s.pt')
Using CPU

image 1/2 inference/images/bus.jpg: 640x512 4 persons, 1 buss, Done. (0.373s)
image 2/2 inference/images/zidane.jpg: 384x640 2 persons, 1 ties, Done. (0.291s)
Results saved to /Users/glennjocher/PycharmProjects/yolov5/inference/output
Done. (0.842s)
(env1) glennjocher@Glenns-MBP yolov5 % 

Thanks bro!! So we need pytorch ( that's the only dependency )

@vishnukv64 see https://github.com/ultralytics/yolov5#requirements

Recommend you start with the colab notebook, its the easiest way to get started playing with things.

@vishnukv64 actually, if you use pytorch hub you don't even need to clone this repo. See https://github.com/ultralytics/yolov5/issues/36

@glenn-jocher Can i load my trained model in pytorch hub and use it? or its only available for pre trained models on cooc dataset?

@vishnukv64 you can do anything you want if you work enough at it.

@glenn-jocher thank you for your help bro!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xinxin342 picture xinxin342  路  3Comments

lisa676 picture lisa676  路  3Comments

milind-soni picture milind-soni  路  3Comments

linhaoqi027 picture linhaoqi027  路  4Comments

nanometer34688 picture nanometer34688  路  3Comments