Skip to content

Commit

Permalink
csvparser
Browse files Browse the repository at this point in the history
  • Loading branch information
Eran_G committed May 30, 2019
1 parent d2aeb1f commit 1dbf026
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,22 @@ def _read_annotations(csv_reader, classes, base_dir, image_existence):

try:
img_file, x1, y1, x2, y2, class_name, width, height = row[:]
x1 = int(x1)
x2 = int(x2)
y1 = int(y1)
y2 = int(y2)
width = int(width)
height = int(height)

if x1 >= width:
x1 = width -1
if x2 >= width:
x2 = width -1

if y1 > height:
y1 = height -1
if y2 >= height:
y2 = height -1

# x1 < 0 | y1 < 0 | x2 <= 0 | y2 <= 0
if x1 < 0 or y1 < 0 or x2 <= 0 or y2 <= 0:
Expand Down

0 comments on commit 1dbf026

Please sign in to comment.