12
12
###########################################################################################
13
13
14
14
import _init_paths
15
+ from utils import *
15
16
from BoundingBox import BoundingBox
16
17
from BoundingBoxes import BoundingBoxes
17
- from Evaluator import *
18
18
19
19
#################################
20
20
#### Defining bounding boxes ####
25
25
# Ground truth bounding boxes of 000002.jpg
26
26
gt_boundingBox_3 = BoundingBox (imageName = '000002' , classId = 'train' , x = 0.5164179104477612 , y = 0.501 , w = 0.20298507462686569 , h = 0.202 , typeCoordinates = CoordinatesType .Relative , bbType = BBType .GroundTruth , format = BBFormat .XYWH , imgSize = (335 ,500 ))
27
27
# Ground truth bounding boxes of 000003.jpg
28
- gt_boundingBox_4 = BoundingBox (imageName = '000003' , classId = 'sofa ' , x = 0.338 , y = 0.4666666666666667 , w = 0.184 , h = 0.10666666666666666 , typeCoordinates = CoordinatesType .Relative , bbType = BBType .GroundTruth , format = BBFormat .XYWH , imgSize = (500 ,375 ))
29
- gt_boundingBox_5 = BoundingBox (imageName = '000003' , classId = 'chair ' , x = 0.546 , y = 0.48133333333333334 , w = 0.136 , h = 0.13066666666666665 , typeCoordinates = CoordinatesType .Relative , bbType = BBType .GroundTruth , format = BBFormat .XYWH , imgSize = (500 ,375 ))
28
+ gt_boundingBox_4 = BoundingBox (imageName = '000003' , classId = 'bench ' , x = 0.338 , y = 0.4666666666666667 , w = 0.184 , h = 0.10666666666666666 , typeCoordinates = CoordinatesType .Relative , bbType = BBType .GroundTruth , format = BBFormat .XYWH , imgSize = (500 ,375 ))
29
+ gt_boundingBox_5 = BoundingBox (imageName = '000003' , classId = 'bench ' , x = 0.546 , y = 0.48133333333333334 , w = 0.136 , h = 0.13066666666666665 , typeCoordinates = CoordinatesType .Relative , bbType = BBType .GroundTruth , format = BBFormat .XYWH , imgSize = (500 ,375 ))
30
30
# Detected bounding boxes of 000001.jpg
31
31
detected_boundingBox_1 = BoundingBox (imageName = '000001' , classId = 'person' , classConfidence = 0.893202 , x = 52 , y = 4 , w = 352 , h = 442 , typeCoordinates = CoordinatesType .Absolute , bbType = BBType .Detected , format = BBFormat .XYX2Y2 , imgSize = (353 ,500 ))
32
32
# Detected bounding boxes of 000002.jpg
53
53
import os
54
54
currentPath = os .path .dirname (os .path .realpath (__file__ ))
55
55
gtImages = ['000001' , '000002' , '000003' ]
56
- for image in gtImages :
57
- im = cv2 .imread (os .path .join (currentPath ,'images' ,'groundtruths' ,image )+ '.jpg' )
56
+ for imageName in gtImages :
57
+ im = cv2 .imread (os .path .join (currentPath ,'images' ,'groundtruths' ,imageName )+ '.jpg' )
58
58
# Add bounding boxes
59
- im = myBoundingBoxes .drawAllBoundingBoxes (im , image )
60
- # cv2.imshow(image +'.jpg', im)
59
+ im = myBoundingBoxes .drawAllBoundingBoxes (im , imageName )
60
+ # cv2.imshow(imageName +'.jpg', im)
61
61
# cv2.waitKey(0)
62
- cv2 .imwrite (os .path .join (currentPath ,'images' ,image + '.jpg' ),im )
63
- print ('Image %s created successfully!' % image )
62
+ cv2 .imwrite (os .path .join (currentPath ,'images' ,imageName + '.jpg' ),im )
63
+ print ('Image %s created successfully!' % imageName )
0 commit comments