Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqwang committed Jul 13, 2021
1 parent 1eccf5f commit 6720a6d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions deployment/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# LibTorch Inference

A LibTorch inference implementation of yolov5. Both GPU and CPU are supported.
The LibTorch inference of yolort. Both GPU and CPU are supported.

## Dependencies

- Ubuntu 18.04
- CUDA 10.2
- LibTorch 1.7.0+
- TorchVision 0.8.1+
- LibTorch 1.8.0 / 1.9.0
- TorchVision 0.9.0 / 0.10.0
- OpenCV 3.4+
- CUDA 10.2 [Optional]

## Usage

Expand All @@ -24,16 +24,16 @@ A LibTorch inference implementation of yolov5. Both GPU and CPU are supported.
```bash
git clone https://github.com/pytorch/vision.git
cd vision
git checkout release/0.8.0 # replace to `nightly` branch instead if you are using the nightly version
git checkout release/0.9 # replace to `nightly` branch instead if you are using the nightly version
mkdir build && cd build
cmake .. -DTorch_DIR=$TORCH_PATH/share/cmake/Torch
cmake .. -DTorch_DIR=$TORCH_PATH/share/cmake/Torch # Set `-DWITH_CUDA=ON` if you're using GPU
make -j4
sudo make install
```

1. Generate `TorchScript` model

Unlike [ultralytics's](https://github.com/ultralytics/yolov5/blob/master/models/export.py) trace (`torch.jit.trace`) mechanism, I'm using `torch.jit.script` to jit trace the YOLO models which containing the whole pre-processing (especially using the `GeneralizedRCNNTransform` ops) and post-processing (especially with the `nms` ops) procedures, so you don't need to rewrite manually the cpp codes of pre-processing and post-processing.
Unlike [ultralytics's](https://github.com/ultralytics/yolov5/blob/master/models/export.py) trace (`torch.jit.trace`) mechanism, We're using `torch.jit.script` to trace the YOLOv5 models which containing the whole pre-processing (especially using the `letterbox` ops) and post-processing (especially with the `nms` ops) procedures, so you don't need to rewrite manually the C++ codes of pre-processing and post-processing.
```bash
git clone https://github.com/zhiqwang/yolov5-rt-stack.git
Expand Down

0 comments on commit 6720a6d

Please sign in to comment.