-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPipelineTest.py
49 lines (29 loc) · 1.09 KB
/
PipelineTest.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
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 11 17:45:10 2019
@author: nithish k
"""
import imageManipulations
import plotGridAndBound
import XMLParser
import assigngrid
import normalization
import denormalization
import generateTargetVariable
xNumGrid = 19
yNumGrid = 19
classMappingDict = {'dog': 0, 'cat' : 1}
inpFilePic = "D:/Assignments/Sem 2/Deep learning/Project/Yolo/dl_project/sample_files/twoObjectsCorrect.jpg"
inpFileXML = "D:/Assignments/Sem 2/Deep learning/Project/Yolo/dl_project/sample_files/twoObjectsCorrect.xml"
outputImg = "normalized_img.jpg"
imageDict, ObjList = XMLParser.parseXMLtoDict(inpFileXML)
targetArray = generateTargetVariable.genTargetArray(inpFilePic,imageDict, ObjList,xNumGrid,yNumGrid,classMappingDict)
##generate new image
#imageResize(inpFilePic,outputImg,29,29)
# BB
filepath = inpFilePic
imageDict, objectList = XMLParser.parseXMLtoDict(inpFileXML)
gridImg = plotGridAndBound.plotGridOnImg(filepath,3,3,objectList)
gridImg.savefig("griddedImage.jpg")
gridImg = plotGridAndBound.plotGridOnImg(inpFilePic,20,20,origObjList)
gridImg.savefig(outputImg)