Comments (5)
You have y2 less than y1 and x2 less than x1. I probably need to fix it in code.
from weighted-boxes-fusion.
Can you provide more deatils?
For example, 2 boxes with large IoU can be present together in case they have different labels (classes).
from weighted-boxes-fusion.
def bb_intersection_over_union(A, B):
xA = max(A[0], B[0])
yA = max(A[1], B[1])
xB = min(A[2], B[2])
yB = min(A[3], B[3])
# compute the area of intersection rectangle
interArea = max(0, xB - xA) * max(0, yB - yA)
if interArea == 0:
return 0.0
# compute the area of both the prediction and ground-truth rectangles
boxAArea = (A[2] - A[0]) * (A[3] - A[1])
boxBArea = (B[2] - B[0]) * (B[3] - B[1])
iou = interArea / float(boxAArea + boxBArea - interArea)
return iou
iou = bb_intersection_over_union(
(0.73385417, 0.34259259, 0.81041667, 0.45648148),
(0.74930206, 0.36653722, 0.79911662, 0.45000624),
)
print(iou)
It gives me 0.476852 < 0.5
from weighted-boxes-fusion.
@ZFTurbo I have found the same problem, maybe this example can help
def bb_intersection_over_union(A, B):
xA = max(A[0], B[0])
yA = max(A[1], B[1])
xB = min(A[2], B[2])
yB = min(A[3], B[3])
# compute the area of intersection rectangle
interArea = max(0, xB - xA) * max(0, yB - yA)
if interArea == 0:
return 0.0
# compute the area of both the prediction and ground-truth rectangles
boxAArea = (A[2] - A[0]) * (A[3] - A[1])
boxBArea = (B[2] - B[0]) * (B[3] - B[1])
iou = interArea / float(boxAArea + boxBArea - interArea)
return iou
iou = bb_intersection_over_union(
(0.99804688, 0.58007812, 0.81835938, 0.43554688),
(0.94726562, 0.55078125, 0.77734375, 0.4140625),
)
print(iou)
>>> 0.0
from weighted-boxes-fusion.
I fixed problem. Earlier method works incorrect if x2 (or y2) was less than x1 (or y1), now it's automatically fixed with warning message. So latest version must be totally ok.
from weighted-boxes-fusion.
Related Issues (20)
- Incorrect conf_type='max' mode HOT 1
- Strange result if boxes are intersected inside one model HOT 2
- confidence score > 1 issue HOT 1
- Bbox is 'Nan' when weights have 0 HOT 4
- How to find the optimal hyper-parameters in the ensembling process HOT 6
- Can work with polygon object ? HOT 1
- Compatibility for Instance Segmentation HOT 1
- Building wheel for llvmlite ... error HOT 1
- How to use in Yolov5
- Implemetation on mobile phone HOT 4
- label list on SSD HOT 1
- run NMS on empty bounding box from one of ensembled models HOT 5
- Single instance NMS
- 2d bbox wbf compute result error
- Is WBF consider to be part of Ensemble Learning HOT 4
- Back propagation when multiple models are ensembled
- model fusion for rotating boxes
- Recall and Confusion matrix, also the confusion matrix, of the WBF HOT 5
- about map_boxes in run_benchmark_oid.py HOT 2
- AttributeError: module 'numpy' has no attribute 'str'
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 weighted-boxes-fusion.