Skip to content

Execution zmeventnotification and python 3.11 and workaround #431

@GGilles46

Description

@GGilles46

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions