Free image memory

This commit is contained in:
JaledMC 2020-11-09 00:36:36 +01:00 committed by GitHub
parent 236205879d
commit 682210bc72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -145,6 +145,7 @@ def image_classification(image, network, class_names):
darknet.copy_image_from_bytes(darknet_image, image_resized.tobytes())
detections = darknet.predict_image(network, darknet_image)
predictions = [(name, detections[idx]) for idx, name in enumerate(class_names)]
darknet.free_image(darknet_image)
return sorted(predictions, key=lambda x: -x[1])