Scaled-YOLOv4: Scaling Cross Stage Partial Network is yolov4-csp. Actual produces erros on CPU so there is a bit modification. This is a small code to build API for newcomers. Please refer to this original link for Scaled Yolov4 AKA yolov4-csp
Implementation is in Pytorch
but you can use the DarkNet
. Please refer to the original documentation.
If you are here, it means that you must be looking for a way to Deploy Scaled Yolov4 model using CPU. Original implementation uses mishcuda
on the model loading itself so it generates error. yolov4-csp
is actually Scaled Yolov4
.
Steps:
- Clone this repo
- Navigate to
ScaledYOLOv4/
- You'll find it empty because all work is done on the
yolov4-csp
branch - On your terminal, do
git checkout yolov4-csp
- Store your model weights somewhere and edit the
weights
variable insideAPI_deploy_CPU.py
(Optional) - run
python API_deploy_CPU.py
. It'll deploy a very very basic model onflask
- Input the path to weights on terminal
- Use
postman
orrequests
module to send the request atlocalhost:5000/predict
. Check the port number first. - Results returned are list of lists in the form of
[ [x_min, y_min, x_max, y_ax, class, conf_score], [......], .....[...], ]
I can bet You've missed step No 4
;)
Code for this API is built around a Single class model. Please change and tweak the code given in detect.py
according to your needs.