PyTorch ,ONNX and TensorRT implementation of YOLOv4

Overview

Pytorch-YOLOv4

A minimal PyTorch implementation of YOLOv4.

├── README.md
├── dataset.py            dataset
├── demo.py               demo to run pytorch --> tool/darknet2pytorch
├── demo_darknet2onnx.py  tool to convert into onnx --> tool/darknet2pytorch
├── demo_pytorch2onnx.py  tool to convert into onnx
├── models.py             model for pytorch
├── train.py              train models.py
├── cfg.py                cfg.py for train
├── cfg                   cfg --> darknet2pytorch
├── data            
├── weight                --> darknet2pytorch
├── tool
│   ├── camera.py           a demo camera
│   ├── coco_annotation.py       coco dataset generator
│   ├── config.py
│   ├── darknet2pytorch.py
│   ├── region_loss.py
│   ├── utils.py
│   └── yolo_layer.py

image

0. Weights Download

0.1 darknet

0.2 pytorch

you can use darknet2pytorch to convert it yourself, or download my converted model.

1. Train

use yolov4 to train your own data

  1. Download weight

  2. Transform data

    For coco dataset,you can use tool/coco_annotation.py.

    # train.txt
    image_path1 x1,y1,x2,y2,id x1,y1,x2,y2,id x1,y1,x2,y2,id ...
    image_path2 x1,y1,x2,y2,id x1,y1,x2,y2,id x1,y1,x2,y2,id ...
    ...
    ...
    
  3. Train

    you can set parameters in cfg.py.

     python train.py -g [GPU_ID] -dir [Dataset direction] ...
    

2. Inference

2.1 Performance on MS COCO dataset (using pretrained DarknetWeights from https://github.com/AlexeyAB/darknet)

ONNX and TensorRT models are converted from Pytorch (TianXiaomo): Pytorch->ONNX->TensorRT. See following sections for more details of conversions.

  • val2017 dataset (input size: 416x416)
Model type AP AP50 AP75 APS APM APL
DarkNet (YOLOv4 paper) 0.471 0.710 0.510 0.278 0.525 0.636
Pytorch (TianXiaomo) 0.466 0.704 0.505 0.267 0.524 0.629
TensorRT FP32 + BatchedNMSPlugin 0.472 0.708 0.511 0.273 0.530 0.637
TensorRT FP16 + BatchedNMSPlugin 0.472 0.708 0.511 0.273 0.530 0.636
  • testdev2017 dataset (input size: 416x416)
Model type AP AP50 AP75 APS APM APL
DarkNet (YOLOv4 paper) 0.412 0.628 0.443 0.204 0.444 0.560
Pytorch (TianXiaomo) 0.404 0.615 0.436 0.196 0.438 0.552
TensorRT FP32 + BatchedNMSPlugin 0.412 0.625 0.445 0.200 0.446 0.564
TensorRT FP16 + BatchedNMSPlugin 0.412 0.625 0.445 0.200 0.446 0.563

2.2 Image input size for inference

Image input size is NOT restricted in 320 * 320, 416 * 416, 512 * 512 and 608 * 608. You can adjust your input sizes for a different input ratio, for example: 320 * 608. Larger input size could help detect smaller targets, but may be slower and GPU memory exhausting.

height = 320 + 96 * n, n in {0, 1, 2, 3, ...}
width  = 320 + 96 * m, m in {0, 1, 2, 3, ...}

2.3 Different inference options

  • Load the pretrained darknet model and darknet weights to do the inference (image size is configured in cfg file already)

    python demo.py -cfgfile <cfgFile> -weightfile <weightFile> -imgfile <imgFile>
  • Load pytorch weights (pth file) to do the inference

    python models.py <num_classes> <weightfile> <imgfile> <IN_IMAGE_H> <IN_IMAGE_W> <namefile(optional)>
  • Load converted ONNX file to do inference (See section 3 and 4)

  • Load converted TensorRT engine file to do inference (See section 5)

2.4 Inference output

There are 2 inference outputs.

  • One is locations of bounding boxes, its shape is [batch, num_boxes, 1, 4] which represents x1, y1, x2, y2 of each bounding box.
  • The other one is scores of bounding boxes which is of shape [batch, num_boxes, num_classes] indicating scores of all classes for each bounding box.

Until now, still a small piece of post-processing including NMS is required. We are trying to minimize time and complexity of post-processing.

3. Darknet2ONNX

  • This script is to convert the official pretrained darknet model into ONNX

  • Pytorch version Recommended:

    • Pytorch 1.4.0 for TensorRT 7.0 and higher
    • Pytorch 1.5.0 and 1.6.0 for TensorRT 7.1.2 and higher
  • Install onnxruntime

    pip install onnxruntime
  • Run python script to generate ONNX model and run the demo

    python demo_darknet2onnx.py <cfgFile> <weightFile> <imageFile> <batchSize>

3.1 Dynamic or static batch size

  • Positive batch size will generate ONNX model of static batch size, otherwise, batch size will be dynamic
    • Dynamic batch size will generate only one ONNX model
    • Static batch size will generate 2 ONNX models, one is for running the demo (batch_size=1)

4. Pytorch2ONNX

  • You can convert your trained pytorch model into ONNX using this script

  • Pytorch version Recommended:

    • Pytorch 1.4.0 for TensorRT 7.0 and higher
    • Pytorch 1.5.0 and 1.6.0 for TensorRT 7.1.2 and higher
  • Install onnxruntime

    pip install onnxruntime
  • Run python script to generate ONNX model and run the demo

    python demo_pytorch2onnx.py <weight_file> <image_path> <batch_size> <n_classes> <IN_IMAGE_H> <IN_IMAGE_W>

    For example:

    python demo_pytorch2onnx.py yolov4.pth dog.jpg 8 80 416 416

4.1 Dynamic or static batch size

  • Positive batch size will generate ONNX model of static batch size, otherwise, batch size will be dynamic
    • Dynamic batch size will generate only one ONNX model
    • Static batch size will generate 2 ONNX models, one is for running the demo (batch_size=1)

5. ONNX2TensorRT

  • TensorRT version Recommended: 7.0, 7.1

5.1 Convert from ONNX of static Batch size

  • Run the following command to convert YOLOv4 ONNX model into TensorRT engine

    trtexec --onnx=<onnx_file> --explicitBatch --saveEngine=<tensorRT_engine_file> --workspace=<size_in_megabytes> --fp16
    • Note: If you want to use int8 mode in conversion, extra int8 calibration is needed.

5.2 Convert from ONNX of dynamic Batch size

  • Run the following command to convert YOLOv4 ONNX model into TensorRT engine

    trtexec --onnx=<onnx_file> \
    --minShapes=input:<shape_of_min_batch> --optShapes=input:<shape_of_opt_batch> --maxShapes=input:<shape_of_max_batch> \
    --workspace=<size_in_megabytes> --saveEngine=<engine_file> --fp16
  • For example:

    trtexec --onnx=yolov4_-1_3_320_512_dynamic.onnx \
    --minShapes=input:1x3x320x512 --optShapes=input:4x3x320x512 --maxShapes=input:8x3x320x512 \
    --workspace=2048 --saveEngine=yolov4_-1_3_320_512_dynamic.engine --fp16

5.3 Run the demo

python demo_trt.py <tensorRT_engine_file> <input_image> <input_H> <input_W>
  • This demo here only works when batchSize is dynamic (1 should be within dynamic range) or batchSize=1, but you can update this demo a little for other dynamic or static batch sizes.

  • Note1: input_H and input_W should agree with the input size in the original ONNX file.

  • Note2: extra NMS operations are needed for the tensorRT output. This demo uses python NMS code from tool/utils.py.

6. ONNX2Tensorflow

7. ONNX2TensorRT and DeepStream Inference

  1. Compile the DeepStream Nvinfer Plugin
    cd DeepStream
    make 
  1. Build a TRT Engine.

For single batch,

trtexec --onnx= --explicitBatch --saveEngine= --workspace= --fp16

For multi-batch,

trtexec --onnx= --explicitBatch --shapes=input:Xx3xHxW --optShapes=input:Xx3xHxW --maxShapes=input:Xx3xHxW --minShape=input:1x3xHxW --saveEngine= --fp16

Note :The maxShapes could not be larger than model original shape.

  1. Write the deepstream config file for the TRT Engine.

Reference:

@article{yolov4,
  title={YOLOv4: YOLOv4: Optimal Speed and Accuracy of Object Detection},
  author={Alexey Bochkovskiy, Chien-Yao Wang, Hong-Yuan Mark Liao},
  journal = {arXiv},
  year={2020}
}
Comments
  • no bbox result when run yolov4 in Jetson NX

    no bbox result when run yolov4 in Jetson NX

    I run yolov4 on Jetson NX,but can not get correct bbox use darknet2onnx.py to convert yolov4.cfg and yolov4.weight. then convert to yolov4.trt when run demo_trt.py yolov4.trt dog.jpg 416 416 get below result /----------------------------------------- Reading engine from file yolov4-416.trt Shape of the network input: (1, 3, 416, 416) Length of inputs: 1 Len of outputs: 9

    TRT inference time: 0.132841
    


     get_region_boxes : 0.002494
                  nms : 0.007532
    

    post process total : 0.010035

    truck: 0.980625 dog: 0.999999 bicycle: 1.000000 /---------------------------------- but no bbox in the predictions_trt.jpg I print the <trt_outputs> check the in demo_trt.pyp line 151 get below value

    /------------------------------------------- [array([1.0889691e-04, 3.5633548e-05, 2.2827997e-05, ..., 3.6400868e-04, 2.5315638e-04, 3.8831109e-05], dtype=float32), array([7.9498291e-03, 1.0000000e+01, 1.8692017e-02, ..., 1.0000000e+01, 4.8004150e-02, 3.5705566e-02], dtype=float32), array([4.1845703e-01, 1.3954163e-02, 8.3496094e-02, ..., 6.1416626e-03, 8.0537796e-04, 1.5139580e-04], dtype=float32), array([4.0929112e-06, 8.2035322e-06, 6.0963603e-06, ..., 4.5659704e-06, 2.2603242e-06, 8.5792357e-07], dtype=float32), array([ 0.02755033, 10. , 0.07742122, ..., 10. , 0.10579979, 0.13517565], dtype=float32), array([3.6437038e-01, 1.7008580e-02, 5.5334978e-02, ..., 7.9847518e-03, 2.9890699e-04, 2.4877247e-04], dtype=float32), array([1.04296953e-06, 2.07851699e-05, 3.73435687e-05, 3.64785374e-05, ...................... , array([0.02295261, 0.00861033, 0.12978163, ..., 0.00506801, 0.00085359, 0.00099795], dtype=float32), array([ 0.06552535, 10. , 0.24504207, ..., 10. , 0.5348558 , 0.55544066], dtype=float32)] //------------------------------------------------------------------------------- I got some wrong value==> 10. ..10. But it is really strange in my PC RTX2070 TRV7.0.0.11 is ok ,no problem. I have no idea about it.

    bug 
    opened by Ashing00 18
  • ValueError: too many values to unpack (expected 2)

    ValueError: too many values to unpack (expected 2)

    Traceback (most recent call last): File "train.py", line 635, in device=device, ) File "train.py", line 425, in train evaluator = evaluate(eval_model, val_loader, config, device) File "/root/anaconda2/envs/pytorch_1_5/lib/python3.6/site-packages/torch/autograd/grad_mode.py", line 15, in decorate_context return func(*args, **kwargs) File "train.py", line 493, in evaluate for img, target, (boxes, confs) in zip(images, targets, outputs): ValueError: too many values to unpack (expected 2)

    Is there any useful solution

    opened by hongrui16 13
  • 请问如何修改demo_trt.py使其适应大批量识别

    请问如何修改demo_trt.py使其适应大批量识别

    我自行修改了一个版本 [[[0.5532519, 0.6153389, 0.8914345, 0.82043, 0.96487856, 0.96487856, 0]]] person: 0.964879 Shape of the network input: (5, 3, 320, 320) Length of inputs: 1 [TensorRT] WARNING: Explicit batch network detected and batch size specified, use enqueue without batch size instead. Len of outputs: 1 可是输出还是为1批次的。 顺便希望加微信群,我可以尝试完成deepstream的移植工作,希望进群讨论

    opened by 17702513221 13
  • onnx推理出错

    onnx推理出错

    您好,是训练好pth模型后,将pth模型转为onnx,然后使用demo_onnx.py进行onnx推理,但onnx的输出全是: [[nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], ..., [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan]],

        [[nan, nan, nan, ..., nan, nan, nan],
    

    ....

    请问是要修改哪里吗??我转出的onnx完全没法使用

    opened by myl980 10
  • 训练时遇到的问题

    训练时遇到的问题

    RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [4, 3, 19, 19, 85]], which is output 0 of AsStridedBackward, is at version 6; expected version 3 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True). 我训练自己的数据集遇到这个问题,之前重来没有遇到过,请问有解决办法吗?

    opened by zh9369 8
  • update demo.py and darknet2pytorch.py

    update demo.py and darknet2pytorch.py

    I added torch weights support for demo.py by adding a new argument "-torch" to avoid issues like this when using demo.py.

    I also fixed the false warning whenever any yolo cfg file is initialized by darknet2pytorch.Darknet when it parses the Linear activation of the convolutional blocks as I mentioned here.

    opened by ajsanjoaquin 7
  • bboxes_pred of shape [m, 22743, 7] and not as expected [m, 60, 5]???

    bboxes_pred of shape [m, 22743, 7] and not as expected [m, 60, 5]???

    I am loading a pretrained model with these cfg settings:

     Cfg.use_darknet_cfg = True
     Cfg.cfgfile = os.path.join(_BASE_DIR, 'cfg', 'yolov4-custom.cfg')
    

    I also edited the classes settings in 'yolov4-custom.cfg' from 80 to 3 ( as in my dataset). Finally this is my script to load the model and evaluate on a give dataset:

     ## Darknet
    
     model = Darknet(Cfg.cfgfile)
    ## Custom YOLO
    #model = Yolov4(yolov4conv137weight=None, n_classes=3, inference=True)
    pretrained_dict = torch.load(load_path, map_location=device)
    model.load_state_dict(pretrained_dict)
    model.to(device = device)
     
    "Build datasets"
    cfg = get_args(**Cfg)
    train_dataset = Yolo_dataset(train_label, Cfg)
    val_dataset = Yolo_dataset(val_label, Cfg)
    test_dataset = Yolo_dataset(test_label, Cfg)
    
    "Evaluate train set"
     train_loader = DataLoader(train_dataset, batch_size= 4, shuffle=True,
                                  num_workers=0, pin_memory=True, drop_last=True, collate_fn = collate)
    criterion = Yolo_loss(device = device, batch = len(train_dataset),n_classes = 3)
    
     with torch.no_grad():
       for i, batch in enumerate(train_loader):
           images = batch[0]
           bboxes = batch[1]
           images = images.to(device= device, dtype=torch.float32)
           bboxes = bboxes.to(device = device)
           model.eval()
           bboxes_pred = model(images)
           train_loss, train_loss_xy, train_loss_wh, train_loss_obj, train_loss_cls, train_loss_l2 = criterion(bboxes_pred, bboxes)
           print(train_loss)
    

    I don't understand why the shape of bboxes_pred is [4, 22743,7] ?? Can someone help me out?

    opened by gmbss0 7
  • error while running models.py with custom trained model

    error while running models.py with custom trained model

    Traceback (most recent call last): File "models.py", line 462, in boxes = do_detect(model, sized, 0.5, n_classes,0.4, use_cuda) File "/home/ubuntu/pytorch-YOLOv4/tool/torch_utils.py", line 247, in do_detect output[-1].append(boxes_and_confs[i][1].cpu().detach().numpy()) IndexError: index 1 is out of bounds for dimension 0 with size 1 any help appreciated!

    opened by imprashr 7
  • demo_trt cannot inference on multiple images

    demo_trt cannot inference on multiple images

    I tried to inference on multiple images in a loop. It copies output of the first image into the output of all others!! Is it a bug? Or there is a different way to do multi-inference?

    opened by makaveli10 6
  • model training issue // 训练模型出错! 求助!!

    model training issue // 训练模型出错! 求助!!

    Hi, I train to train the model on my dataset, other parts work fine but when it starts training, it raises an error, "shape '[4, 3, 8, 76, 76]' is invalid for the input of size 5891520. Does anyone know what might cause this error?

    opened by lr13953301387 5
  • The predict result problem

    The predict result problem

    Whwn I finish training the model with yolov4,and the result is look pretty good. I use it to test my test datasets, the accuracy is nice but sometimes will happend double recognize. What's the reason to cause the problem?

    擷取

    opened by er778899789 5
  • Loss decreases when noise is introduced to the inputs. Loss calculation might be wrong.

    Loss decreases when noise is introduced to the inputs. Loss calculation might be wrong.

    When I introduce random noise to the input loss.item() decreases. Part of the code for training is included here.

      for epoch in range(epochs):
            # model.train()
            epoch_loss = 0
            epoch_step = 0
    
            with tqdm(total=n_train, desc=f'Epoch {epoch + 1}/{epochs}', unit='img', ncols=50) as pbar:
                for i, batch in enumerate(train_loader):
                    global_step += 1
                    epoch_step += 1
                    images = batch[0]
                    bboxes = batch[1]
                    paths = batch[2]
    
                    images = images.to(device=device, dtype=torch.float32)
                    images.requires_grad = True
                    bboxes = bboxes.to(device=device)
                    bboxes_pred = model(images)
    
                    loss, loss_xy, loss_wh, loss_obj, loss_cls, loss_l2 = criterion(
                        bboxes_pred, bboxes)
    
                    print("Without Noise - ", loss.item(), loss_xy.item(), loss_wh.item(),
                          loss_obj.item(), loss_cls.item(), loss_l2.item())
    
                    grad = torch.autograd.grad(loss, [images], create_graph=True,
                                               retain_graph=True, allow_unused=True)[0]
    
                    # loss.backward()
    
                    noise = torch.randn(images.size())
                    imgs = images.detach().cpu() + noise
    
                    imgs = imgs.to(device=device, dtype=torch.float32)
    
                    bboxes_pred = model(imgs)
    
                    loss, loss_xy, loss_wh, loss_obj, loss_cls, loss_l2 = criterion(
                        bboxes_pred, bboxes)
    
                    print("With Noise - ", loss.item(), loss_xy.item(), loss_wh.item(),
                          loss_obj.item(), loss_cls.item(), loss_l2.item())
    

    Output - Without Noise - 20.36496353149414 0.0 0.0 20.36496353149414 0.0 6.040985584259033 With Noise - 1.169505000114441 0.0 0.0 1.169505000114441 0.0 0.05301150307059288 --------- looping again Without Noise - 25.24418830871582 0.0 0.0 25.24418830871582 0.0 7.514528274536133 With Noise - 1.8068726062774658 0.0 0.0 1.8068726062774658 0.0 0.12245824933052063 --------- looping again Without Noise - 1.1534618139266968 0.0 0.0 1.1534618139266968 0.0 0.2820863425731659 With Noise - 0.8495630025863647 0.0 0.0 0.8495630025863647 0.0 0.034061141312122345 --------- looping again Without Noise - 2754.517333984375 3.337832450866699 2730.53369140625 18.649364471435547 1.9963617324829102 5465.08642578125 With Noise - 2763.16845703125 2.5691161155700684 2741.94189453125 13.955108642578125 4.702309608459473 5486.26513671875

    opened by Shah-imran 0
  • Bump pillow from 7.1.2 to 9.3.0

    Bump pillow from 7.1.2 to 9.3.0

    Bumps pillow from 7.1.2 to 9.3.0.

    Release notes

    Sourced from pillow's releases.

    9.3.0

    https://pillow.readthedocs.io/en/stable/releasenotes/9.3.0.html

    Changes

    ... (truncated)

    Changelog

    Sourced from pillow's changelog.

    9.3.0 (2022-10-29)

    • Limit SAMPLESPERPIXEL to avoid runtime DOS #6700 [wiredfool]

    • Initialize libtiff buffer when saving #6699 [radarhere]

    • Inline fname2char to fix memory leak #6329 [nulano]

    • Fix memory leaks related to text features #6330 [nulano]

    • Use double quotes for version check on old CPython on Windows #6695 [hugovk]

    • Remove backup implementation of Round for Windows platforms #6693 [cgohlke]

    • Fixed set_variation_by_name offset #6445 [radarhere]

    • Fix malloc in _imagingft.c:font_setvaraxes #6690 [cgohlke]

    • Release Python GIL when converting images using matrix operations #6418 [hmaarrfk]

    • Added ExifTags enums #6630 [radarhere]

    • Do not modify previous frame when calculating delta in PNG #6683 [radarhere]

    • Added support for reading BMP images with RLE4 compression #6674 [npjg, radarhere]

    • Decode JPEG compressed BLP1 data in original mode #6678 [radarhere]

    • Added GPS TIFF tag info #6661 [radarhere]

    • Added conversion between RGB/RGBA/RGBX and LAB #6647 [radarhere]

    • Do not attempt normalization if mode is already normal #6644 [radarhere]

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • "python models.py 80 "./checkpoints/yolov4.pth" "./data/dog.jpg" 576 768" Error

    File "models.py", line 509, in plot_boxes_cv2(img, boxes[0], 'predictions.jpg', class_names) File "/home/duys/workspace/pytorch-YOLOv4/tool/utils.py", line 140, in plot_boxes_cv2 cv2.rectangle(img, (x1,y1), (np.float32(c3[0]), np.float32(c3[1])), rgb, -1) cv2.error: OpenCV(4.6.0) :-1: error: (-5:Bad argument) in function 'rectangle'

    Overload resolution failed:

    • Can't parse 'pt2'. Sequence item with index 0 has a wrong type
    • Can't parse 'pt2'. Sequence item with index 0 has a wrong type
    • Can't parse 'rec'. Expected sequence length 4, got 2
    • Can't parse 'rec'. Expected sequence length 4, got 2
    opened by duys3416 1
  • Bugfix: do_detect gets 4 or 5 arg, but receives 6

    Bugfix: do_detect gets 4 or 5 arg, but receives 6

    do_detect() has an extra argument. Comparing to previous version used to be boxes = do_detect(model, sized, 0.0, 0.4, use_cuda) but now it is boxes = do_detect(model, sized, 0.0, 80, 0.4, use_cuda) Is this a typo? do_detect() wasn't changed to accommodate an extra argument.

    opened by DShaience 1
Owner
DL CV OCR and algorithm optimization
null
YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )

Yolo v4, v3 and v2 for Windows and Linux (neural networks for object detection) Paper YOLO v4: https://arxiv.org/abs/2004.10934 Paper Scaled YOLO v4:

Alexey 20.2k Jan 9, 2023
This package proposes simplified exporting pytorch models to ONNX and TensorRT, and also gives some base interface for model inference.

PyTorch Infer Utils This package proposes simplified exporting pytorch models to ONNX and TensorRT, and also gives some base interface for model infer

Alex Gorodnitskiy 11 Mar 20, 2022
A high-performance anchor-free YOLO. Exceeding yolov3~v5 with ONNX, TensorRT, NCNN, and Openvino supported.

YOLOX is an anchor-free version of YOLO, with a simpler design but better performance! It aims to bridge the gap between research and industrial communities. For more details, please refer to our report on Arxiv.

null 7.7k Jan 6, 2023
YOLOX is a high-performance anchor-free YOLO, exceeding yolov3~v5 with ONNX, TensorRT, ncnn, and OpenVINO supported.

Introduction YOLOX is an anchor-free version of YOLO, with a simpler design but better performance! It aims to bridge the gap between research and ind

null 7.7k Jan 3, 2023
Export CenterPoint PonintPillars ONNX Model For TensorRT

CenterPoint-PonintPillars Pytroch model convert to ONNX and TensorRT Welcome to CenterPoint! This project is fork from tianweiy/CenterPoint. I impleme

CarkusL 149 Dec 13, 2022
Very simple NCHW and NHWC conversion tool for ONNX. Change to the specified input order for each and every input OP. Also, change the channel order of RGB and BGR. Simple Channel Converter for ONNX.

scc4onnx Very simple NCHW and NHWC conversion tool for ONNX. Change to the specified input order for each and every input OP. Also, change the channel

Katsuya Hyodo 16 Dec 22, 2022
A very simple tool to rewrite parameters such as attributes and constants for OPs in ONNX models. Simple Attribute and Constant Modifier for ONNX.

sam4onnx A very simple tool to rewrite parameters such as attributes and constants for OPs in ONNX models. Simple Attribute and Constant Modifier for

Katsuya Hyodo 6 May 15, 2022
An executor that loads ONNX models and embeds documents using the ONNX runtime.

ONNXEncoder An executor that loads ONNX models and embeds documents using the ONNX runtime. Usage via Docker image (recommended) from jina import Flow

Jina AI 2 Mar 15, 2022
ONNX Runtime Web demo is an interactive demo portal showing real use cases running ONNX Runtime Web in VueJS.

ONNX Runtime Web demo is an interactive demo portal showing real use cases running ONNX Runtime Web in VueJS. It currently supports four examples for you to quickly experience the power of ONNX Runtime Web.

Microsoft 58 Dec 18, 2022
ONNX-GLPDepth - Python scripts for performing monocular depth estimation using the GLPDepth model in ONNX

ONNX-GLPDepth - Python scripts for performing monocular depth estimation using the GLPDepth model in ONNX

Ibai Gorordo 18 Nov 6, 2022
ONNX-PackNet-SfM: Python scripts for performing monocular depth estimation using the PackNet-SfM model in ONNX

Python scripts for performing monocular depth estimation using the PackNet-SfM model in ONNX

Ibai Gorordo 14 Dec 9, 2022
A very simple tool for situations where optimization with onnx-simplifier would exceed the Protocol Buffers upper file size limit of 2GB, or simply to separate onnx files to any size you want.

sne4onnx A very simple tool for situations where optimization with onnx-simplifier would exceed the Protocol Buffers upper file size limit of 2GB, or

Katsuya Hyodo 10 Aug 30, 2022
Simple ONNX operation generator. Simple Operation Generator for ONNX.

sog4onnx Simple ONNX operation generator. Simple Operation Generator for ONNX. https://github.com/PINTO0309/simple-onnx-processing-tools Key concept V

Katsuya Hyodo 6 May 15, 2022
Simple tool to combine(merge) onnx models. Simple Network Combine Tool for ONNX.

snc4onnx Simple tool to combine(merge) onnx models. Simple Network Combine Tool for ONNX. https://github.com/PINTO0309/simple-onnx-processing-tools 1.

Katsuya Hyodo 8 Oct 13, 2022
Implementation of "Scaled-YOLOv4: Scaling Cross Stage Partial Network" using PyTorch framwork.

YOLOv4-large This is the implementation of "Scaled-YOLOv4: Scaling Cross Stage Partial Network" using PyTorch framwork. YOLOv4-CSP YOLOv4-tiny YOLOv4-

Kin-Yiu, Wong 2k Jan 2, 2023
Torchyolo - Yolov3 ve Yolov4 modellerin Pytorch uygulamasıdır

TORCHYOLO : Yolo Modellerin Pytorch Uygulaması Yapılacaklar: Yolov3 model.py ve

Kadir Nar 3 Aug 22, 2022
A Keras implementation of YOLOv4 (Tensorflow backend)

keras-yolo4 请使用更完善的版本: https://github.com/miemie2013/Keras-YOLOv4 Please visit here for more complete model: https://github.com/miemie2013/Keras-YOLOv

null 384 Nov 29, 2022
The modify PyTorch version of Siam-trackers which are speed-up by TensorRT.

SiamTracker-with-TensorRT The modify PyTorch version of Siam-trackers which are speed-up by TensorRT or ONNX. [Updating...] Examples demonstrating how

null 9 Dec 13, 2022