HuskyLens is an easy-to-use AI machine vision sensor. It is equipped with multiple functions, such as face recognition, object tracking, object recognition, line tracking, color recognition, and tag(QR code) recognition.
By lucadagostino84
#43747
Hi everyone,
I'm having some problems configuring HuskyLens with Raspbery Pi.
I have connected Huskylens to I2C and set up I2C in the chamber.
When I run the example script from the library however it generates an error, where am I going wrong?

this is my code:
Code: Select all
from huskylib import HuskyLensLibrary

camera = HuskyLensLibrary("I2C","",address=0x32)

print("First request a knock: {}".format(camera.knock()))
camera.algorthim("ALGORITHM_FACE_RECOGNITION")

while(true):
    data=camera.blocks()
    x=0
    for i in data:
        x=x+1
        print("Face {} data: {}".format(x,i)) 

This is the error:

First request a knock: Knock Recieved
Traceback (most recent call last):
File "/home/pi/huskycam/test/huskylib.py", line 179, in processReturnData
commandSplit[4][2:4]+commandSplit[4][0:2], 16)
TypeError: int() can't convert non-string with explicit base

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "prova.py", line 6, in <module>
camera.algorthim("ALGORITHM_FACE_RECOGNITION")
File "/home/pi/huskycam/test/huskylib.py", line 387, in algorthim
return self.processReturnData()
File "/home/pi/huskycam/test/huskylib.py", line 217, in processReturnData
self.huskylensSer.timeout=5
AttributeError: 'SMBus' object has no attribute 'timeout'
[email protected]:~/huskycam/test $ python3 prova.py
First request a knock: Knock Recieved
Traceback (most recent call last):
File "/home/pi/huskycam/test/huskylib.py", line 179, in processReturnData
commandSplit[4][2:4]+commandSplit[4][0:2], 16)
TypeError: int() can't convert non-string with explicit base

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "prova.py", line 6, in <module>
camera.algorthim("ALGORITHM_FACE_RECOGNITION")
File "/home/pi/huskycam/test/huskylib.py", line 387, in algorthim
return self.processReturnData()
File "/home/pi/huskycam/test/huskylib.py", line 217, in processReturnData
self.huskylensSer.timeout=5
AttributeError: 'SMBus' object has no attribute 'timeout'


thanks for support

Luca
By klasstaffan
#44261
HuskyLens is pretty easy-to-use. You can change various algorithms by pressing the function button. Click the learning button, HuskyLens starts learning new things. After that, HuskyLens is able to recognize them.