MCPcopy Create free account
hub / github.com/PaddlePaddle/Research / parseXLSX

Function parseXLSX

CV/VehicleCounting/eval/eval.py:10–34  ·  view source on GitHub ↗
(xlsxName, parseArray)

Source from the content-addressed store, hash-verified

8
9
10def parseXLSX(xlsxName, parseArray):
11 wb = pyxl.load_workbook(xlsxName)
12 sheet_names = wb.sheetnames
13 ws = wb[sheet_names[0]]
14 for i in range(2, ws.max_row+1):
15 cvalue = ws.cell(row = i, column = 2).value
16 if cvalue is not None:
17 fId = int(cvalue)
18 else:
19 import pdb; pdb.set_trace()
20 cvalue = ws.cell(row = i, column = 3).value
21 if cvalue is not None:
22 mId = int(cvalue)
23 else:
24 import pdb; pdb.set_trace()
25 cvalue = ws.cell(row = i, column = 4).value
26 if cvalue is not None:
27 if cvalue == "car" or cvalue == "car ":
28 type = 0
29 elif cvalue == "truck" or cvalue == "truch":
30 type = 1
31 else:
32 import pdb; pdb.set_trace()
33
34 parseArray[fId, mId - 1, type] = 1
35
36
37#def parseTxt(TxtName, parseArray):

Callers 1

eval.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected