Comments (13)
Use the score to filter out
from libfacedetection.train.
Sir the confidence is high for the false detection, is there a way to add negative samples in training
from libfacedetection.train.
Also increasing the confidence decreases the detection rate too
from libfacedetection.train.
you can show some detetection results with the confidence scores.
from libfacedetection.train.
I noticed this when detection resolution is higher than the network was trained with. When resizing images to 320 before detection (and priors are made with that as well), I'm getting expected results.
from libfacedetection.train.
@ShiqiYu Sir I have trained the model (original caffe yunetv1) on wider dataset, (I have modified the pytorch model to match the original caffe v1 model), and in this model testing I am experiencing false positives, may be the model is too simple to handle such complex cases, that's why i am asking if you can help in adding negative samples. I am thinking of adding hand images with bounding box and class label as background in training data but getting error as
RuntimeError: invalid argument 2: non-empty vector or matrix expected at /pytorch/aten/src/THCUNN/generic/ClassNLLCriterion.cu:31
how can i modify the multibox loss function in this case to support images only with background label
from libfacedetection.train.
This image has detection on hand with 86% confidence
from libfacedetection.train.
As suggested by @vladkol , you can resize the image to a smaller one, then detect it.
from libfacedetection.train.
i am doing detection at 160x120 dimension, i just want to know the way i can modify the multiloss function to accept negative samples
from libfacedetection.train.
Got the exact same issue here. I've already resized to 320 and still got tons of false positives, like the back of the head dog faces etc. It will be very helpful to have negative examples as training inputs.
from libfacedetection.train.
from libfacedetection.train.
Need to collect again. I do see hard negative examples code inside multibox_loss.py. Will you be able to share a version that takes negative examples inputs ?
Can you provide the image to test and debug?
…
On Sun, Sep 6, 2020 at 11:52 PM boarder8383 @.***> wrote: Got the exact same issue here. I've already resized to 320 and still got tons of false positives, like the back of the head etc. It will be very helpful to have negative examples as training inputs. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#16 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWR4HISG6STMBVQFV554YLSEOV2ZANCNFSM4NSPJI7A .
Need to
from libfacedetection.train.
So We need to do some changes to train with negative samples in data.py and multibox_loss.py
In file data.py
In class PreProc , if we pass an image with label index == 0, we can return empty numpy,
if int(labels_t[0]) == 0:
return image_t, np.empty(0)
In the xml file, you can pass background as label for negative images
In multiloss.py
In line where we parse the batches, we need to compare the size of the target
If empty array is encountered we can initialize 0 valued arrays
for idx in range(num):
if len(targets[idx]) < 1 :
#print(targets[idx])
#print("Amazing")
truths = torch.zeros(1,4)
truths = truths.cuda()
labels = torch.zeros(1,1)
labels = labels.cuda()
else :
truths = targets[idx][:, 0:4].data
labels = targets[idx][:, -1].data
You can also perform this initialization of 0-valued arrays in data.py.
Now comes the part what if all items in a batch contains negative samples, than we will have error in calcualting crossentropy because we are calculating neg_indexes based on pos_indexes and if pos_index is 0 we get 0 neg_indexes and empty array is passed in crossentropy
To pass that , i have initialized a tensor when i get this situation like
num_pos = pos.long().sum(1, keepdim=True)
num_neg = torch.clamp(self.negpos_ratio*num_pos, max=pos.size(1)-1)
#######ERRO HANDLE#########
if num_neg.sum().item() == 0.0:
print('++++++++++++++++++++++++++EMPTY',num_neg.size(),num_neg)
p = torch.tensor(np.array([[100]]),dtype=torch.int64)
num_neg = torch.clamp(p.expand_as(num_pos), max=pos.size(1)-1)
num_neg = num_neg.to('cuda:0')
##########################
from libfacedetection.train.
Related Issues (20)
- 模型是否支持关键点输出 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
- 带出onnx出错 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.