Python package with latest versions of YOLO architecture for training and inference
Project description
DetExecutor
Python package with latest versions of YOLO architecture for training and inference
Install
Installing is quite simple, just use pip:
pip3 install det_executor
Train
Training support is still in progress!
Inference
Get available models
from det_executor import DetExecutor
# print list of supported arches
DetExecutor.list_arch()
Output
{
"yolov7": YoloArch(
version="7",
img_size=(640, 640),
size="75.6MB",
params="37.6M",
flops="",
module="yolov7_package",
load_link="yolov7.pt",
trainable=False,
traced=False,
),
"yolov7x": YoloArch(
version="7",
img_size=(640, 640),
size="75.6MB",
params="71.3M",
flops="",
module="yolov7_package",
load_link="yolov7x.pt",
trainable=False,
traced=False,
),
"yolov7-w6": YoloArch(
version="7",
img_size=(1280, 1280),
size="141.3MB",
params="70.4M",
flops="",
module="yolov7_package",
load_link="yolov7-w6.pt",
trainable=False,
traced=False,
),
"yolov7-e6": YoloArch(
version="7",
img_size=(1280, 1280),
size="195.0MB",
params="97.2M",
flops="",
module="yolov7_package",
load_link="yolov7-e6.pt",
trainable=False,
traced=False,
),
"yolov7-d6": YoloArch(
version="7",
img_size=(1280, 1280),
size="286.3MB",
params="133.8M",
flops="",
module="yolov7_package",
load_link="yolov7-d6.pt",
trainable=False,
traced=False,
),
"yolov7-e6e": YoloArch(
version="7",
img_size=(1280, 1280),
size="304.4MB",
params="151.8M",
flops="",
module="yolov7_package",
load_link="yolov7-e6e.pt",
trainable=False,
traced=False,
),
"yolov7-traced": YoloArch(
version="7",
img_size=(640, 640),
size="74.3MB",
params="36.9M",
flops="",
module="yolov7_package",
load_link="1L8mPcUvabUscEk6Nr8ck5EFgopgPAMDW",
trainable=False,
traced=True,
),
"yolov7-tiny": YoloArch(
version="7",
img_size=(640, 640),
size="12.6MB",
params="6.2M",
flops="",
module="yolov7_package",
load_link="yolov7-tiny.pt",
trainable=False,
traced=False,
),
"yolov7-tiny-traced": YoloArch(
version="7",
img_size=(640, 640),
size="12.7MB",
params="6.2M",
flops="",
module="yolov7_package",
load_link="18zJyljtolPENDI_kFw3FlRFnQTnaLuDF",
trainable=False,
traced=True,
),
"yolov8n": YoloArch(
version="8",
img_size=(640, 640),
size="6.5MB",
params="3.2M",
flops="",
module="yolov8",
load_link="yolov8n.pt",
trainable=False,
traced=False,
),
"yolov8s": YoloArch(
version="8",
img_size=(640, 640),
size="22.6MB",
params="11.2M",
flops="",
module="yolov8",
load_link="yolov8s.pt",
trainable=False,
traced=False,
),
"yolov8m": YoloArch(
version="8",
img_size=(640, 640),
size="52.1MB",
params="25.9M",
flops="",
module="yolov8",
load_link="yolov8m.pt",
trainable=False,
traced=False,
),
"yolov8l": YoloArch(
version="8",
img_size=(640, 640),
size="87.8MB",
params="43.7M",
flops="",
module="yolov8",
load_link="yolov8l.pt",
trainable=False,
traced=False,
),
"yolov8x": YoloArch(
version="8",
img_size=(640, 640),
size="136.9MB",
params="68.2M",
flops="",
module="yolov8",
load_link="yolov8x.pt",
trainable=False,
traced=False,
),
"yolos-tiny": YoloArch(
version="s",
img_size=None,
size="136.9MB",
params="6.5M",
flops="512x*>18.8G|256x*>3.4G",
module="yolos",
load_link="hustvl/yolos-tiny",
trainable=False,
traced=False,
),
}
Loading model
from det_executor import DetExecutor
# loading model
name = 'yolov7'
ex = DetExecutor(name)
Predict and draw
from det_executor import DetExecutor, draw_on_image
import cv2
# loading model
name = 'yolov7'
ex = DetExecutor(name)
# loading image
img = ex.load_image('test/img.jpg')
# or img = cv2.imread('test/img.jpg')
# predict
classes, boxes, scores = ex.predict(img)
# draw
img = draw_on_image(img, boxes[0], scores[0], classes[0])
cv2.imshow("image", img)
cv2.waitKey()
Roadmap
- Training pipeline for all models
- Load from custom weights
- More models
Citation
@article{wang2022yolov7,
title={{YOLOv7}: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors},
author={Wang, Chien-Yao and Bochkovskiy, Alexey and Liao, Hong-Yuan Mark},
journal={arXiv preprint arXiv:2207.02696},
year={2022}
}
@misc{fang2021look,
title={You Only Look at One Sequence: Rethinking Transformer in Vision through Object Detection},
author={Yuxin Fang and Bencheng Liao and Xinggang Wang and Jiemin Fang and Jiyang Qi and Rui Wu and Jianwei Niu and Wenyu Liu},
year={2021},
eprint={2106.00666},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
det_executor-0.0.8.tar.gz
(97.2 kB
view details)
Built Distribution
det_executor-0.0.8-py3-none-any.whl
(103.2 kB
view details)
File details
Details for the file det_executor-0.0.8.tar.gz
.
File metadata
- Download URL: det_executor-0.0.8.tar.gz
- Upload date:
- Size: 97.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76f376192addd8824113dd0a2c85b31c1a5a0e3de3d5dc403f5a5ab4ece13e51 |
|
MD5 | dd6f5c80b21c8f367d84e4ca81436921 |
|
BLAKE2b-256 | 0ca195918ca8d80ef91074bf48ab7c5c0af87c798ed87c0d6dfb0c087cb3f3fb |
File details
Details for the file det_executor-0.0.8-py3-none-any.whl
.
File metadata
- Download URL: det_executor-0.0.8-py3-none-any.whl
- Upload date:
- Size: 103.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce7b004cf67e47447b9eb27671eae2c97dd5a3d8f6782d9aa70a2f2d21249d76 |
|
MD5 | 6bb7c6324bd14ade75b480afae86774c |
|
BLAKE2b-256 | 7db43023f5e06b0b8090a277c26a81cee21fe2bdb68075f04ef4def8c350a759 |