mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Update cascade_convert.py
convert the map variable to a tuple to avoid "TypeError: 'map' object is not subscriptable" error
This commit is contained in:
parent
8feaf6df78
commit
72eacbf350
@ -191,7 +191,7 @@ def cascade_binary(path, n_stages, name):
|
||||
idx = int(f.childNodes[0].nodeValue.split()[2])
|
||||
rects = feature[idx].getElementsByTagName('_')
|
||||
for r in rects:
|
||||
l = map(int, r.childNodes[0].nodeValue[:-1].split())
|
||||
l = (map(int, r.childNodes[0].nodeValue[:-1].split()))
|
||||
fout.write(struct.pack('b', l[4])) #int8_t NOTE: multiply by 4096
|
||||
|
||||
# write rects
|
||||
@ -199,7 +199,7 @@ def cascade_binary(path, n_stages, name):
|
||||
idx = int(f.childNodes[0].nodeValue.split()[2])
|
||||
rects = feature[idx].getElementsByTagName('_')
|
||||
for r in rects:
|
||||
l = map(int, r.childNodes[0].nodeValue[:-1].split())
|
||||
l = (map(int, r.childNodes[0].nodeValue[:-1].split()))
|
||||
fout.write(struct.pack('BBBB',l[0], l[1], l[2], l[3])) #uint8_t
|
||||
|
||||
# print cascade info
|
||||
|
||||
Loading…
Reference in New Issue
Block a user