Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

function to measure intersection over union

# function to compute the IoU function
def bb_intersection_over_union(boxA, boxB):
	# determine the (x, y)-coordinates of the intersection rectangle
	xA = max(boxA[0], boxB[0])
	yA = max(boxA[1], boxB[1])
	xB = min(boxA[2], boxB[2])
	yB = min(boxA[3], boxB[3])
	# compute the area of intersection rectangle
	interArea = max(0, xB - xA + 1) * max(0, yB - yA + 1)
	# compute the area of both the prediction and ground-truth
	# rectangles
	boxAArea = (boxA[2] - boxA[0] + 1) * (boxA[3] - boxA[1] + 1)
	boxBArea = (boxB[2] - boxB[0] + 1) * (boxB[3] - boxB[1] + 1)
	# compute the intersection over union by taking the intersection
	# area and dividing it by the sum of prediction + ground-truth
	# areas - the interesection area
	iou = interArea / float(boxAArea + boxBArea - interArea)
	# return the intersection over union value
	return iou
Comment

PREVIOUS NEXT
Code Example
Python :: do i need do some set when i use GPU to train tensorflow model 
Python :: how to make a calcukatir 
Python :: How to code a simple rock, paper, scissors game on Python 
Python :: no module named 
Python :: python loop 3 times 
Python :: parce que in english 
Python :: how to create an auto clicker in python 
Python :: calculate iqr in python dataset example 
Python :: python scatter size 
Python :: what is manage.py 
Python :: pass multiple arguments to map function python 
Python :: how to add items in list in python at specific position 
Python :: python encoding declaration 
Python :: how to move an item from one list to another python 
Python :: pong code python 
Python :: if something in something python example 
Python :: comparing values in python 
Python :: scipy cdf example 
Python :: python excel sheet import 
Python :: think python 
Python :: python split large xml file by tag 
Python :: EJERCICIOS DE FOR Y WHILE en python 
Python :: plant python documentation 
Python :: keylogger to exe 
Python :: roll dice python 
Shell :: linux get cpu frequency 
Shell :: emu8086 registration key 
Shell :: list process using port 
Shell :: git set email for project 
Shell :: kill ubuntu port 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =