Sunday, February 4, 2018

Intersection over union - Object detection



During object detection ,

When the image has more than one anchor box after filtering by thresholding over the classes scores , we use non-max suppression to get one anchor box for object detection.

Non-max suppression uses intersection over union.

Intersection over union calculates the intersection area of any two boxes by area of union of two boxes.

Here we have considered the  coordinates of each box which are diagonal like top left and bottom right

Our naming conventions here for each box  (x1,y1) – top left and (x2,y2) – bottom right.






Now for two boxes to calculate the intersection need to find the maximum for top left and minimum of bottom right.

X1_inter = max(box1(x1), box2(x1))
Y1_inter = max(box1(y1), box2(y1))
X2_inter = min(box1(x2), box2(x2))
Y2_inter = min(box1(y2), box2(y2))

Here is the code to implement iou:


Monday, November 21, 2016

Remove the line numbers in source code using notepad++


A sample code with line numbers:

01<!DOCTYPE html>
02<html>
03<head>
04 <meta http-equiv="X-UA-Compatible" content="IE=edge">
05 <meta charset="utf-8">
06 <title>Hello App!</title>
07 <script>


To remove the numbers in each line of code, do the following:


  • Copy the code into notepad++
  • Type Ctrl + H
  • Under Search Mode choose Regular Expression.
  • In Find What :Enter ^\d+
  • Leave the Replace with: as blank
  • Now click Replace All


Now the code looks like:


<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<title>Hello App!</title>
<script>