-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtesting_rotations_sanity.py
63 lines (32 loc) · 1.62 KB
/
testing_rotations_sanity.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 27 15:01:55 2019
@author: nithish k
"""
import plotGridAndBound
import pickle
import decodePredictionArray
inpfilePattern = "./Train images/New Cutom Dataset Trial/OrigData/images/*"
inpXmlFiles = "./Train images/New Cutom Dataset Trial/OrigData/xmls/*"
outputdirImages = "./Train images/New Cutom Dataset Trial/augmented data/images/"
outputAnnotations = "./Train images/New Cutom Dataset Trial/augmented data/annotations/"
imgFilepath = "./Train images/New Cutom Dataset Trial/augmented data/images/0_90.jpg"
with open(outputAnnotations+'/ImageDictsAllFiles.pkl', 'rb') as f:
imgDicts = pickle.load(f)
with open(outputAnnotations+'/ObjectListsAllFiles.pkl', 'rb') as f:
objLists = pickle.load(f)
with open(outputAnnotations+'/AllTargetArray.pkl', 'rb') as f:
AllImgTargetArray = pickle.load(f)
gridImg = plotGridAndBound.plotGridOnImg(imgFilepath,19,19,objLists[1])
gridImg.savefig("griddedImage")
objectList = decodePredictionArray.decodePredArr(imgDicts[1],AllImgTargetArray[1],classMappingDict)
gridImg = plotGridAndBound.plotGridOnImg(imgFilepath,19,19,objectList,dispClassLabel=False)
gridImg.savefig("griddedImage")
inpfile = "./Train images/New Cutom Dataset Trial/resized/images/0_270.jpg"
inputAnnotations = "./Train images/New Cutom Dataset Trial/resized/annotations/"
with open(inputAnnotations+'/ImageDictsAllFiles.pkl', 'rb') as f:
imgDicts = pickle.load(f)
with open(inputAnnotations+'/ObjectListsAllFiles.pkl', 'rb') as f:
objLists = pickle.load(f)
gridImg = plotGridAndBound.plotGridOnImg(inpfile,19,19,objLists[3])
gridImg.savefig("griddedImage")