Comments (13)
@FeiGeChuanShu @hylrh2008 Are the steps at:
https://github.com/Megvii-BaseDetection/YOLOX/tree/main/demo/ncnn/cpp
enough?
from ncnn-android-yolox.
@FeiGeChuanShu @hylrh2008 Are the steps at:
https://github.com/Megvii-BaseDetection/YOLOX/tree/main/demo/ncnn/cpp
enough?
yes, follow these steps you can convert your yolox model to a ncnn model. then replace the model file and change the postprocess in this android demo code.
from ncnn-android-yolox.
@FeiGeChuanShu Thanks a lot. so if the custom trained yolox has different number of classes and names, we just need to replace:
https://github.com/FeiGeChuanShu/ncnn-android-yolox/blob/f0acf18f23899bf58b113a162530a24ef72011ef/app/src/main/jni/yolox.cpp
line: 409 with the corresponding new class names?
from ncnn-android-yolox.
@FeiGeChuanShu Thanks a lot. so if the custom trained yolox has different number of classes and names, we just need to replace:
https://github.com/FeiGeChuanShu/ncnn-android-yolox/blob/f0acf18f23899bf58b113a162530a24ef72011ef/app/src/main/jni/yolox.cppline: 409 with the corresponding new class names?
yes
from ncnn-android-yolox.
can we get the app link?
from ncnn-android-yolox.
I tried it, I got an error while transform *.pth to *.onnx model:
from ncnn-android-yolox.
The issue is with onnxsim:
from onnxsim import simplify
# use onnxsimplify to reduce reduent model.
onnx_model = onnx.load(args.output_name)
model_simp, check = simplify(onnx_model)
if we add:
--no-onnxsim
then no issue at all.
from ncnn-android-yolox.
One more question, if the *.param is:
7767517
310 346
Input images 0 1 images
Split splitncnn_input0 1 4 images images_splitncnn_0 images_splitncnn_1 images_splitncnn_2 images_splitncnn_3
MemoryData 1156 0 1 1156 0=1
MemoryData 1164 0 1 1164 0=1
MemoryData 1172 0 1 1172 0=1
Crop Slice_4 1 1 images_splitncnn_3 647 -23309=1,0 -23310=1,2147483647 -23311=1,1
Crop Slice_9 1 1 647 652 -23309=1,0 -23310=1,2147483647 -23311=1,2
Crop Slice_14 1 1 images_splitncnn_2 657 -23309=1,0 -23310=1,2147483647 -23311=1,1
Crop Slice_19 1 1 657 662 -23309=1,1 -23310=1,2147483647 -23311=1,2
Crop Slice_24 1 1 images_splitncnn_1 667 -23309=1,1 -23310=1,2147483647 -23311=1,1
Crop Slice_29 1 1 667 672 -23309=1,0 -23310=1,2147483647 -23311=1,2
Crop Slice_34 1 1 images_splitncnn_0 677 -23309=1,1 -23310=1,2147483647 -23311=1,1
Crop Slice_39 1 1 677 682 -23309=1,1 -23310=1,2147483647 -23311=1,2
Concat Concat_40 4 1 652 672 662 682 683 0=0
Convolution Conv_41 1 1 683 1177 0=16 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=1728
Swish Mul_43 1 1 1177 687
How to manually modify it?
Thanks a lot.
from ncnn-android-yolox.
One more question, if the *.param is:
7767517
310 346
Input images 0 1 images
Split splitncnn_input0 1 4 images images_splitncnn_0 images_splitncnn_1 images_splitncnn_2 images_splitncnn_3
MemoryData 1156 0 1 1156 0=1
MemoryData 1164 0 1 1164 0=1
MemoryData 1172 0 1 1172 0=1
Crop Slice_4 1 1 images_splitncnn_3 647 -23309=1,0 -23310=1,2147483647 -23311=1,1
Crop Slice_9 1 1 647 652 -23309=1,0 -23310=1,2147483647 -23311=1,2
Crop Slice_14 1 1 images_splitncnn_2 657 -23309=1,0 -23310=1,2147483647 -23311=1,1
Crop Slice_19 1 1 657 662 -23309=1,1 -23310=1,2147483647 -23311=1,2
Crop Slice_24 1 1 images_splitncnn_1 667 -23309=1,1 -23310=1,2147483647 -23311=1,1
Crop Slice_29 1 1 667 672 -23309=1,0 -23310=1,2147483647 -23311=1,2
Crop Slice_34 1 1 images_splitncnn_0 677 -23309=1,1 -23310=1,2147483647 -23311=1,1
Crop Slice_39 1 1 677 682 -23309=1,1 -23310=1,2147483647 -23311=1,2
Concat Concat_40 4 1 652 672 662 682 683 0=0
Convolution Conv_41 1 1 683 1177 0=16 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=1728
Swish Mul_43 1 1 1177 687How to manually modify it?
Thanks a lot.
https://zhuanlan.zhihu.com/p/391788686 refer this url
from ncnn-android-yolox.
@FeiGeChuanShu Thanks a lot.
So for my above *.param, I should modify it as:
7767517
301 346
Input images 0 1 images
MemoryData 1156 0 1 1156 0=1
MemoryData 1164 0 1 1164 0=1
MemoryData 1172 0 1 1172 0=1
YoloV5Focus focus 1 1 images 683
Convolution Conv_41 1 1 683 1177 0=16 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=1728
Swish Mul_43 1 1 1177 687
Shall I keep the 3 lines of 'MemoryData'?
from ncnn-android-yolox.
@FeiGeChuanShu Thanks a lot.
So for my above *.param, I should modify it as:
7767517
301 346
Input images 0 1 images
MemoryData 1156 0 1 1156 0=1
MemoryData 1164 0 1 1164 0=1
MemoryData 1172 0 1 1172 0=1
YoloV5Focus focus 1 1 images 683
Convolution Conv_41 1 1 683 1177 0=16 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=1728
Swish Mul_43 1 1 1177 687Shall I keep the 3 lines of 'MemoryData'?
i don‘s know why your model have these ops,could you show me your onnx?
from ncnn-android-yolox.
@FeiGeChuanShu I am trying to attach it, but the system is not allowed.
According to: https://zhuanlan.zhihu.com/p/391788686
请教一下,我转出来的param多出了MemoryData这三行:
Input images 0 1 images
Split splitncnn_input0 1 4 images images_splitncnn_0 images_splitncnn_1 images_splitncnn_2 images_splitncnn_3
MemoryData 1156 0 1 1156 0=1
MemoryData 1164 0 1 1164 0=1
MemoryData 1172 0 1 1172 0=1
按照步骤删去crop之后优化模型也顺利,看不出什么问题。但是跑ncnn demo代码时,就提示layer Shape not exists or registered。怎么回事呢
需要用onnx-simplifier把这些层给去掉之后再改focus
When I use export_onnx.py to generate *.onnx, I disabled:
--no-onnxsim
When I enabled onnixsim, then I got the error message as shown before.
I also tried:
https://github.com/daquexian/onnx-simplifier
I got the exact same error message.
Thanks a lot.
from ncnn-android-yolox.
I figured it out it is a version issue, we have to use:
otherwise, it will not work.
from ncnn-android-yolox.
Related Issues (20)
- as 在debug模式下 会自动断到这 然后重复循环, 放开后会直接程序崩溃
- Can't get custom network to perform in ncnn HOT 4
- ncnn-20210720-android-vulkan 编译出错 HOT 1
- 自己的数据集训练,屏幕出现很多检测框
- YOLOX sluggish on GPU
- 导入AS之后可能出现的错误
- Android SDK HOT 1
- 如何在rk3399运行 HOT 1
- 你好,修改网络结构之后还能继续用这个么? HOT 1
- 只显示视频没有目标检测 HOT 2
- attention:the version of opencv and ncnn HOT 1
- ninja: build stopped: subcommand failed.
- 训练自己数据集后,生成onnx文件,转ncnn部署到手机上没有检测出目标 HOT 2
- Still cannot run custom training model in this Project. HOT 5
- W/ncnn: AAssetManager_open yolox-nano.param failed HOT 1
- 如何调用PC外接的摄像头实现实时检测的?
- 在on_image_render函数下对图像rgb进行灰度化,结果会导致手机上闪退
- Hello
- Is this project support latest yolox?? HOT 15
- where is tnn code ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ncnn-android-yolox.