Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution zmeventnotification and python 3.11 and workaround #431

Open
GGilles46 opened this issue Mar 26, 2024 · 0 comments
Open

Execution zmeventnotification and python 3.11 and workaround #431

GGilles46 opened this issue Mar 26, 2024 · 0 comments

Comments

@GGilles46
Copy link

Event Server version

6.1.29

Hooks version (if you are using Object Detection)

app:6.1.29, pyzm:0.3.64

Are you using MLAPI? (Y/N)
N

The version of ZoneMinder you are using:
1.37.56

What is the nature of your issue

Bug

Details

Execution de zmeventnotification

Debug Logs (if applicable)
03/26/24 15:34:23 zmesdetect[5725] ERR detect_sequence.py:710 [Error running model: module 'PIL.Image' has no attribute 'ANTIALIAS'] 03/26/24 15:34:23 zmesdetect[5725] DBG2 detect_sequence.py:711 [Traceback (most recent call last): File "/usr/local/lib/python3.11/dist-packages/pyzm/ml/detect_sequence.py", line 707, in detect_stream _b,_l,_c,_m = m.detect(image=frame) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/pyzm/ml/object.py", line 78, in detect b,l,c,_model_names = self.model.detect(image) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/pyzm/ml/coral_edgetpu.py", line 167, in detect _, scale = common.set_resized_input( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/pycoral/adapters/common.py", line 98, in set_resized_input result = resize((w, h)) ^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/pyzm/ml/coral_edgetpu.py", line 168, in <lambda> self.model, img.size, lambda size: img.resize(size, Image.ANTIALIAS)) ^^^^^^^^^^^^^^^ AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'

The workaround is to modify /usr/local/lib/python3.11/dist-packages/pyzm/ml/coral_edgetpu.py line 168
_, scale = common.set_resized_input(

self.model, img.size, lambda size: img.resize(size, Image.ANTIALIAS))

            self.model, img.size, lambda size: img.resize(size, Image.LANCZOS))

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant