Comments (5)
@Wwupup Please take a look.
from libfacedetection.train.
Hello, I just tested this model and found no problems you said. Please confirm whether the input size is scaled to 320x320. My test code is as follows:
python tools/compare_inference.py ./onnx/yunet_yunet_final_320_320_simplify.onnx --image test.jpg --mode 320,320
from libfacedetection.train.
However,according to this code
class PriorBox(object):
def __init__(self, min_sizes, steps, clip, ratio):
super(PriorBox, self).__init__()
self.min_sizes = min_sizes
self.steps = steps
self.clip = clip
self.ratio = ratio
def __call__(self, image_size):
# given 320
feature_map_2th = [int(int((image_size[0] + 1) / 2) / 2),
int(int((image_size[1] + 1) / 2) / 2)]
# 2th 80
feature_map_3th = [int(feature_map_2th[0] / 2),
int(feature_map_2th[1] / 2)]
# 3th 40
feature_map_4th = [int(feature_map_3th[0] / 2),
int(feature_map_3th[1] / 2)]
# 4th 20
feature_map_5th = [int(feature_map_4th[0] / 2),
int(feature_map_4th[1] / 2)]
# 5th 10
feature_map_6th = [int(feature_map_5th[0] / 2),
int(feature_map_5th[1] / 2)]
# 6th 5
feature_maps = [feature_map_3th, feature_map_4th,
feature_map_5th, feature_map_6th]
anchors = []
for k, f in enumerate(feature_maps):
min_sizes = self.min_sizes[k]
for i, j in product(range(f[0]), range(f[1])):
for min_size in min_sizes:
cx = (j + 0.5) * self.steps[k] / image_size[1]
cy = (i + 0.5) * self.steps[k] / image_size[0]
for r in self.ratio:
s_ky = min_size / image_size[0]
s_kx = r * min_size / image_size[1]
anchors += [cx, cy, s_kx, s_ky]
# back to torch land
output = torch.Tensor(anchors).view(-1, 4)
if self.clip:
output.clamp_(max=1, min=0)
return output
feature_maps
will be [40,20,10,5]
As min_sizes: [[10, 16, 24], [32, 48], [64, 96], [128, 192, 256]]
And 40x40+20x20+10x10+5x5=2125 ,but the number of priors in output of the onnx model is 5875, it's not divisible by 2125('x' stands for multiplication as pairs of '*' are recognized by markdown as italics)
I can't understand this thought I know your code should be fine。
from libfacedetection.train.
Hello,
As feature_maps=[40, 20, 10, 5]
with min_sizes: [[10, 16, 24], [32, 48], [64, 96], [128, 192, 256]]
,
the anchor_num=40x40x3 + 20x20x2 + 10x10x2 + 5x5x3 = 5875
from libfacedetection.train.
Thanks for reply , since I'm rewriting the C++ version of inference in TensorRT, I may not be familiar with this kind of multiple traversal.
from libfacedetection.train.
Related Issues (20)
- can not export to onnx HOT 2
- 模型是否支持关键点输出 HOT 8
- 当转onnx的时候,验证pytorch模型推理和onnx推理时候出现问题 HOT 2
- Cannot download labelsv2 HOT 3
- nonsquare input size training and exporting HOT 1
- How to train with custom dataset by using the pretrained model? HOT 2
- where can we get datasets with key points to train Yunet?
- 最小像素点修改 HOT 1
- 图像预处理时的均值和方差为什么是[0,0,0]和[1,1,1] HOT 1
- 老师,如果在Win上配置了MMDET环境后,如何修改指令执行train.py呀? HOT 5
- Why can't I find the yunet_final.pth weight file HOT 2
- Did you try Focal loss, how about its performance ? HOT 1
- The problem has been solved
- Train on rotated images to improve landmarks. HOT 1
- pytrch2onnx convervsion issue HOT 2
- 训练完成导出C++部署不成功
- Problems installing the repo HOT 1
- Batch inference problem! HOT 1
- Not able to setup the training environment HOT 9
- 为啥数据不做归一化 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 libfacedetection.train.