Skip to content

Commit eb247d0

Browse files
authored
Merge pull request #5 from edgeimpulse/custom-example-fix
Fix custom example with hex features
2 parents 198d04d + 7dd8d46 commit eb247d0

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

examples/custom/classify.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ def main(argv):
3939

4040
features_file = io.open(args[1], 'r', encoding='utf8')
4141
features = features_file.read().strip().split(",")
42-
features = [float(f) for f in features]
42+
if '0x' in features[0]:
43+
features = [float(int(f, 16)) for f in features]
44+
else:
45+
features = [float(f) for f in features]
4346

4447

4548
dir_path = os.path.dirname(os.path.realpath(__file__))

0 commit comments

Comments
 (0)