Skip to content

Commit 79d5c57

Browse files
committed
upgrade mobilenetv3 to tensorrt 10
Signed-off-by: makaveli10 <vineet.suryan@collabora.com>
1 parent e29066e commit 79d5c57

File tree

6 files changed

+827
-377
lines changed

6 files changed

+827
-377
lines changed

mobilenet/mobilenetv3/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,13 @@ link_directories(/usr/local/cuda/lib64)
1919
include_directories(/usr/include/x86_64-linux-gnu/)
2020
link_directories(/usr/lib/x86_64-linux-gnu/)
2121

22+
# Find OpenCV
23+
find_package(OpenCV REQUIRED)
24+
2225
add_executable(mobilenetv3 ${PROJECT_SOURCE_DIR}/mobilenet_v3.cpp)
26+
target_include_directories(mobilenetv3 PRIVATE ${OpenCV_INCLUDE_DIRS})
2327
target_link_libraries(mobilenetv3 nvinfer)
2428
target_link_libraries(mobilenetv3 cudart)
29+
target_link_libraries(mobilenetv3 ${OpenCV_LIBS})
2530

2631
add_definitions(-O2 -pthread)

mobilenet/mobilenetv3/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ For the Pytorch implementation, you can refer to [mobilenetv3.pytorch](https://g
1515

1616
```
1717
cd tensorrtx/mobilenet/mobilenetv3
18+
sudo apt install libopencv-dev -y
1819
mkdir build
1920
cd build
2021
cmake ..
2122
make
22-
sudo ./mobilenetv3 -s small(or large) // serialize model to plan file i.e. 'mobilenetv3_small.engine'
23-
sudo ./mobilenetv3 -d small(or large) // deserialize plan file and run inference
23+
sudo ./mobilenetv3 -s small(or large) // serialize model to plan file i.e. 'mobilenetv3_small.engine'
24+
sudo ./mobilenetv3 -d small(or large) // deserialize plan file and run inference
25+
sudo ./mobilenetv3 -d small(or large) image.jpg // deserialize plan file and run inference on an image
2426
```
2527

2628
4. see if the output is same as pytorch side
@@ -36,7 +38,8 @@ sudo ./mobilenetv3 -d small(or large) // deserialize plan file and run inferenc
3638
3739
cd tensorrtx/mobilenet/mobilenetv3
3840
39-
python mobilenet_v2.py -s small(or large) // serialize model to plan file i.e. 'mobilenetv2.engine'
40-
python mobilenet_v2.py -d small(or large) // deserialize plan file and run inference
41+
python mobilenet_v2.py -s small(or large) // serialize model to plan file i.e. 'mobilenetv2.engine'
42+
python mobilenet_v2.py -d small(or large) // deserialize plan file and run inference
43+
python mobilenet_v2.py -d small(or large) --image image.jpg // deserialize plan file and run inference on an image
4144
4245
```

mobilenet/mobilenetv3/logging.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ class Logger : public nvinfer1::ILogger {
209209
//! Note samples should not be calling this function directly; it will eventually go away once we eliminate the
210210
//! inheritance from nvinfer1::ILogger
211211
//!
212-
void log(Severity severity, const char* msg) override {
212+
void log(Severity severity, const char* msg) noexcept override {
213213
LogStreamConsumer(mReportableSeverity, severity) << "[TRT] " << std::string(msg) << std::endl;
214214
}
215215

0 commit comments

Comments
 (0)