A PyTorch implementation of the YOLOX object detection model based on the mmdetection implementation.
Project description
cjm-yolox-pytorch
Install
pip install cjm_yolox_pytorch
How to use
import torch
from cjm_yolox_pytorch.model import MODEL_TYPES, build_model
Select model type
model_type = MODEL_TYPES[0]
model_type
'yolox_tiny'
Build YOLOX model
yolox = build_model(model_type, 19, pretrained=True)
test_inp = torch.randn(1, 3, 256, 256)
with torch.no_grad():
cls_scores, bbox_preds, objectness = yolox(test_inp)
print(f"cls_scores: {[cls_score.shape for cls_score in cls_scores]}")
print(f"bbox_preds: {[bbox_pred.shape for bbox_pred in bbox_preds]}")
print(f"objectness: {[objectness.shape for objectness in objectness]}")
The file ./pretrained_checkpoints/yolox_tiny.pth already exists and overwrite is set to False.
cls_scores: [torch.Size([1, 19, 32, 32]), torch.Size([1, 19, 16, 16]), torch.Size([1, 19, 8, 8])]
bbox_preds: [torch.Size([1, 4, 32, 32]), torch.Size([1, 4, 16, 16]), torch.Size([1, 4, 8, 8])]
objectness: [torch.Size([1, 1, 32, 32]), torch.Size([1, 1, 16, 16]), torch.Size([1, 1, 8, 8])]
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
cjm-yolox-pytorch-0.0.147.tar.gz
(23.6 kB
view hashes)
Built Distribution
Close
Hashes for cjm-yolox-pytorch-0.0.147.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9453a2d9208761ed0c26c8ddfab7b651c58278134eccef04efa90d6bcfe5ce1b |
|
MD5 | 03acdb8c5d3c4074aac2854daaf4966a |
|
BLAKE2b-256 | 5df21b34e4cf859f43b60767bf75f8350f782c51c793a2c5b5f859a46b3885fa |
Close
Hashes for cjm_yolox_pytorch-0.0.147-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4221b1a2f7c5f5c34e1eabcd0922e0d95e21175cfb29239663c80a42130968a4 |
|
MD5 | 449f92df6b4bf68c7dd5b81dc8629270 |
|
BLAKE2b-256 | 998d2116d2bd24ccac4bb0bab8b021cf5f6464f8e43da8aa59922d9dae500fde |