image = graph.GetImage(True) # Use the built-in camera as input to return images
File "../../../hsapi/core/graph.py", line 140, in GetImage
mean_value = c_float(self.mean_value)
TypeError: a float is required
device_list = hs.EnumerateDevices() # Get all connected devices
device = hs.Device(device_list[0]) # Get a Device instance
device.OpenDevice() # Open device
with open('/home/inomjon/Projects/Movidius/Sungem/SungemSDK-Python/examples/graphs/pet_magic', mode='rb') as f:
data = f.read()
graph = device.AllocateGraph(data, scale, mean) # Get a Graph instance
try:
while True:
Use the built-in camera of the Horned Sungem as input
image = graph.GetImage(True) # Use the built-in camera as input to return images
output, _ = graph.GetResult() # Read neural network output
print(output)
cv2.imshow("horned-sungem", image)
cv2.waitKey(1)
image = graph.GetImage(True) # Use the built-in camera as input to return images File "../../../hsapi/core/graph.py", line 140, in GetImage mean_value = c_float(self.mean_value) TypeError: a float is required
Single-device Single-model
import cv2, numpy, sys sys.path.append('../../../') import hsapi as hs # import libs
scale = 1 # Image preprocessing parameters mean = [104.0, 117.0, 123.0] # Image preprocessing parameters
device_list = hs.EnumerateDevices() # Get all connected devices device = hs.Device(device_list[0]) # Get a Device instance
device.OpenDevice() # Open device
with open('/home/inomjon/Projects/Movidius/Sungem/SungemSDK-Python/examples/graphs/pet_magic', mode='rb') as f: data = f.read() graph = device.AllocateGraph(data, scale, mean) # Get a Graph instance
try: while True:
Use the built-in camera of the Horned Sungem as input
finally: graph.DeallocateGraph() # Release neural network resources device.CloseDevice() # Close device
Above my code and error i have got, please guide me how to solve the issue, Thanks in advance