Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what is the mean of iouThreshold #44

Closed
haydenzhourepo opened this issue Oct 30, 2020 · 3 comments
Closed

what is the mean of iouThreshold #44

haydenzhourepo opened this issue Oct 30, 2020 · 3 comments

Comments

@haydenzhourepo
Copy link

First Tks for your nice project.
I am a bit confuse of the mean of iou parameter and it impact the result of the detection, and i use this lib for face detection, I'm wonder of how to set iouThreshold value correctly.

@esimov
Copy link
Owner

esimov commented Oct 30, 2020

IoU means intersection over union.

Because the detector is based on pixel intensity comparison, this means that it’s also sensible to small perturbations and variations of the underlying pixel data, influenced mostly by the scaling and the rotation of the objects, resulting overlaps in detection. This is the reason why the cascade detections are clustered together in a post processing step and the final result is produced by applying the intersection over union formula on the detected clusters.

To answer your question in most use cases the default value should just work fine. But you can also adapt the IoU value to your specific environment (light conditions for example), so I suggest if the default value is not working for you then adjust it accordingly. You should adjust it with a point decimal difference, because it is slightly sensible and might results in multiple overlapping detections. You should also check the iou value used on the real time examples (python and wasm version). I hope that this answered your question.

Endre

@haydenzhourepo
Copy link
Author

haydenzhourepo commented Nov 1, 2020

according to ClusterDetections function's code segment:

for j := 0; j < len(detections); j++ {
				// Check if the comparison result is below a certain threshold.
				if calcIoU(detections[i], detections[j]) > iouThreshold {
					assignments[j] = true
					r += detections[j].Row
					c += detections[j].Col
					s += detections[j].Scale
					q += detections[j].Q
					n++
				}
			}

Int this snippet, The calcloU fun which in the for's inner loop calutate the iou value of two detections,and if the calculated value is grater than the iouThreshold param , we union the two detections as one detection result, the same as the follow sequence dectections. As a result we get one unioned result in a inner loop. so the smaller the iouThreshold params is, the lesser the results num is. becouse if iouThreshold params is smaller we will union more detections as only one result.

So, Whether this comment // Check if the comparison result is below a certain threshold. should be // Check if the comparison result is greater then a certain threshold. if so we union the detections

esimov added a commit that referenced this issue Nov 2, 2020
@esimov
Copy link
Owner

esimov commented Nov 2, 2020

Thanks for this notification. It has been corrected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants