Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -214,21 +214,24 @@ def measureproject(result,dataDoc=0,img=0,dxffile=0):
|
|
| 214 |
imgss=[]
|
| 215 |
dpxlinks=[]
|
| 216 |
legendLinks=[]
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
|
|
|
|
|
|
|
|
|
| 232 |
|
| 233 |
################################# -2.2- #################################
|
| 234 |
# elif result[5][2].startswith('2.2'): #section value - 2.2 rc slabs
|
|
@@ -667,8 +670,6 @@ def cvtSummarytoXML(jsdata):
|
|
| 667 |
# print(result[1])
|
| 668 |
xmllink=google_sheet_to_xml.create_xml(documentname=result[1],dbPath=path)
|
| 669 |
return jsonify(xmllink)
|
| 670 |
-
|
| 671 |
-
|
| 672 |
#_________________________________________________________________________________________________________________________
|
| 673 |
#_________________________________________________________________________________________________________________________
|
| 674 |
|
|
|
|
| 214 |
imgss=[]
|
| 215 |
dpxlinks=[]
|
| 216 |
legendLinks=[]
|
| 217 |
+
listofmarkups=[]
|
| 218 |
+
print('RATIOS=',result[4])
|
| 219 |
+
# for i in range(len(result[0])):
|
| 220 |
+
dbpdfpath,pdflink=tsadropboxretrieval.getPathtoPDF_File(nameofPDF=result[0])
|
| 221 |
+
dbxTeam= tsadropboxretrieval.ADR_Access_DropboxTeam('user')
|
| 222 |
+
md, res =dbxTeam.files_download(path=dbpdfpath)
|
| 223 |
+
dataDoc = res.content
|
| 224 |
+
annotatedimg,pdf_document,spreadsheet_url, list1=doors_fasterrcnn.main_run(dataDoc,'combined.pth',result[0],pdfpath, result[4]) #single_double.pth
|
| 225 |
+
|
| 226 |
+
dbPath='/TSA JOBS/ADR Test'+pdfpath+'Measured Plan/'
|
| 227 |
+
pdflink= tsadropboxretrieval.uploadanyFile(doc=pdf_document,path=dbPath,pdfname='annotated-'+result[0]) #doc=doc,pdfname=path,pdfpath=pdfpath+'Measured Plan/'
|
| 228 |
+
print(pdflink)
|
| 229 |
+
# dpxlinks.append(pdflink)
|
| 230 |
+
# legendLinks.append(spreadsheet_url)
|
| 231 |
+
# listofmarkups.append(list1.to_dict())
|
| 232 |
+
_, buffer = cv2.imencode('.png', annotatedimg)
|
| 233 |
+
# imgss.append(base64.b64encode(buffer).decode('utf-8'))
|
| 234 |
+
arr=[base64.b64encode(buffer).decode('utf-8') ,pdflink,spreadsheet_url,list1.to_dict()]# , spreadsheetId, spreadsheet_url , list1.to_dict()]
|
| 235 |
|
| 236 |
################################# -2.2- #################################
|
| 237 |
# elif result[5][2].startswith('2.2'): #section value - 2.2 rc slabs
|
|
|
|
| 670 |
# print(result[1])
|
| 671 |
xmllink=google_sheet_to_xml.create_xml(documentname=result[1],dbPath=path)
|
| 672 |
return jsonify(xmllink)
|
|
|
|
|
|
|
| 673 |
#_________________________________________________________________________________________________________________________
|
| 674 |
#_________________________________________________________________________________________________________________________
|
| 675 |
|