Skip to content

Commit f34069c

Browse files
committed
creating sample 1
1 parent adb50d2 commit f34069c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

samples/sample_1/sample_1.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
###########################################################################################
1313

1414
import _init_paths
15+
from utils import *
1516
from BoundingBox import BoundingBox
1617
from BoundingBoxes import BoundingBoxes
17-
from Evaluator import *
1818

1919
#################################
2020
#### Defining bounding boxes ####
@@ -25,8 +25,8 @@
2525
# Ground truth bounding boxes of 000002.jpg
2626
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))
2727
# 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))
3030
# Detected bounding boxes of 000001.jpg
3131
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))
3232
# Detected bounding boxes of 000002.jpg
@@ -53,11 +53,11 @@
5353
import os
5454
currentPath = os.path.dirname(os.path.realpath(__file__))
5555
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')
5858
# 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)
6161
# 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

Comments
 (0)