I have a labeled dataset for object detection few thousands of images with annotation on csv file
the csv contains these columns image_path, class, xmax, xmin, ymax, ymin
looks like Pascal voc format labeles but when I plot it, it does't work and all labels look wrong
I noticed that there are some values in negtive in xmin, ymin and that's weird
so I'm asking which kind of labeling formats that has the possibility to have these kinds of values because it's ?
as example a bbox has these
xmax: 429 xmin: -68 ymax = 390 ymin = 130
the code I used is:
import cv2
import pandas as pd
df = pd.read_csv('train.csv')
directory = 'dataset/images'
color = (255, 0, 0)
thickness = 2
org = (50, 50)
fontScale = 1
font = cv2.FONT_HERSHEY_SIMPLEX
for i in df.index:
image_path = df.iloc[i]['image_path']
xmax = int(df.iloc[i]['xmax'])
xmin = int(df.iloc[i]['xmin'])
ymax = int(df.iloc[i]['ymax'])
ymin = int(df.iloc[i]['ymin'])
txt = df.iloc[i]['name']
x= xmax - xmin
y = ymax - ymin
start_point = (xmin,ymin)
end_point = (xmax,ymax)
img = cv2.imread(directory+ '/'+image_path)
image = cv2.putText(img, txt, org, font,
fontScale, color, thickness, cv2.LINE_AA)
bbox_img = cv2.rectangle(image, start_point, end_point, color, thickness)
cv2.imshow('image window', bbox_img)
# add wait key. window waits until user presses a key
cv2.waitKey(0)
# and finally destroy/close all open windows
cv2.destroyAllWindows()