IndentationError
This commit is contained in:
@@ -120,11 +120,15 @@ async def main():
|
|||||||
if len(sys.argv) > 1:
|
if len(sys.argv) > 1:
|
||||||
image_file = sys.argv[1]
|
image_file = sys.argv[1]
|
||||||
if os.path.exists(image_file):
|
if os.path.exists(image_file):
|
||||||
|
client = DaygloDetectorMQTTClient("dayglo_detector")
|
||||||
|
client.set_auth_credentials(MQTT_USERNAME, MQTT_PASSWORD)
|
||||||
|
await client.connect(MQTT_BROKER, MQTT_PORT, keepalive=60)
|
||||||
print(f"Processing image from file: {image_file}")
|
print(f"Processing image from file: {image_file}")
|
||||||
image = cv2.imread(image_file)
|
image = cv2.imread(image_file)
|
||||||
if image is not None:
|
if image is not None:
|
||||||
rating = calculate_dayglo_rating(image)
|
rating = calculate_dayglo_rating(image)
|
||||||
print("Dayglo Rating calculated from file:", rating)
|
print("Dayglo Rating calculated from file:", rating)
|
||||||
|
await publish_rating(client, rating)
|
||||||
else:
|
else:
|
||||||
print("Invalid image file provided.")
|
print("Invalid image file provided.")
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user