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

No Faces Detected #12

Closed
JeCheeseSmith opened this issue Jan 11, 2024 · 11 comments
Closed

No Faces Detected #12

JeCheeseSmith opened this issue Jan 11, 2024 · 11 comments

Comments

@JeCheeseSmith
Copy link

Hi!

First of all, thank you and other contributors for maintaining and expanding this functionality! I'm a user of Nextcloud AIO and I'm very glad there is this option now. (I'm unsure if I should post this here or on https://github.com/nextcloud/all-in-one )

I've set up the container and it seems to be running, however, on each image, 0 faces get detected and the nextcloud logs are filled with this error:

Trying to access array offset on value of type null at /var/www/html/custom_apps/facerecognition/lib/Model/ExternalModel/ExternalModel.php#181

The following error is repeatingly showing in the container log:
[2024-01-11 18:03:39,598] ERROR in app: Exception on /detect [POST] Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/flask/app.py", line 1455, in wsgi_app response = self.full_dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/flask/app.py", line 869, in full_dispatch_request rv = self.handle_user_exception(e) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/flask/app.py", line 867, in full_dispatch_request rv = self.dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/flask/app.py", line 852, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/facerecognition-external-model.py", line 60, in decorated_function return view_function(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/facerecognition-external-model.py", line 148, in detect_faces faces = DETECT_FACES_FUNCTIONS[FACE_MODEL](img) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/facerecognition-external-model.py", line 69, in cnn_detect dets: list = CNN_DETECTOR(img) ^^^^^^^^^^^^^^^^^ TypeError: 'NoneType' object is not callable 172.27.0.7 - - [11/Jan/2024 18:03:39] "�[35m�[1mPOST /detect HTTP/1.1�[0m" 500 -

Might I've made a mistake in the installation? Is it a bug?

I use nextcloud as part of my homeserver hobby and I sadly have no experience in this field.

If I can supply any extra information needed, let me know!

@matiasdelellis
Copy link
Owner

Hi @JeCheeseSmith
It seems that the service was restarted for some reason while it is running. See #10

Check the container logs. In principle it is fixed on a77a3af, but I'm interested in knowing why it restarted

@JeCheeseSmith
Copy link
Author

Hi @JeCheeseSmith It seems that the service was restarted for some reason while it is running. See #10

Check the container logs. In principle it is fixed on a77a3af, but I'm interested in knowing why it restarted

Thanks for your fast reply!

Probably a "noob" question, but how do I even specify using the newer image? (If thats possible using the community container of AIO?)

@szaimen
Copy link
Contributor

szaimen commented Jan 12, 2024

Probably a "noob" question, but how do I even specify using the newer image? (If thats possible using the community container of AIO?)

If a different image_tag shall be used, it needs to be updated in AIO. That is why I would usually recommend to use an image_tag like latest or e.g. v1 in there. Otherwise the maintainer - @matiasdelellis would always need to update the tag in AIO manually...

@matiasdelellis
Copy link
Owner

Probably a "noob" question, but how do I even specify using the newer image? (If thats possible using the community container of AIO?)

Soon update my container and the community container to fix this. 😉
However, in your case, something restarted the facerecognition-external-model container, while the background_job command within the community container was still running. 🤔

If a different image_tag shall be used, it needs to be updated in AIO. That is why I would usually recommend to use an image_tag like latest or e.g. v1 in there. Otherwise the maintainer - @matiasdelellis would always need to update the tag in AIO manually...

Hi @szaimen
Of course... I was waiting perhaps for other fixes. There is a new 0.2.0 tag but I did not update the community container because it did not affect its operation.

About the tag name, personally don't like the use of the ":latest" tag, and I prefer to keep a real version in the tags.

@szaimen
Copy link
Contributor

szaimen commented Jan 12, 2024

About the tag name, personally don't like the use of the ":latest" tag, and I prefer to keep a real version in the tags.

I see but you will need to do that manually then each time ;)

@szaimen
Copy link
Contributor

szaimen commented Jan 12, 2024

My personal recommendation would be to create a tag like v1 and put minor changes into that and if there are major changes you switch to v2, etc.

@matiasdelellis
Copy link
Owner

My personal recommendation would be to create a tag like v1 and put minor changes into that and if there are major changes you switch to v2, etc.

Great. We agree.. Probably in the afternoon I will update both containers. 😉

@JeCheeseSmith
Copy link
Author

Soon update my container and the community container to fix this. 😉 However, in your case, something restarted the facerecognition-external-model container, while the background_job command within the community container was still running. 🤔

I did reran the task mannualy by using the occ face:background_task command since I adjusted some settings (like process shared_folders). Should or shouldn't I do that?

Unsure if this has something to do with it: I use docker-compose which means the nextcloud container stays running, even after I use docker compose down. (The master container goes down) (Unless I stop it mannualy, by using the interface or commmands).

matiasdelellis added a commit that referenced this issue Jan 15, 2024
It is recommended, since the maximum size and the type of files are
reported there, but if not called (Because for example the service was
restarted, or Docker Swarm is being used), automatically initializes
models before using them.

The security model is the use of shared API keys. and in any case we
must reject the requests if they do not have the correct keys, or if
dont comply with the imposed restrictions.
@matiasdelellis
Copy link
Owner

Ok.. In the last commits I changed our "protocol" to not need to call /open. If the service is restarted (or a container cluster is made), the service works automatically because it initializes the model when necessary. 😉

/open is also used to obtain the maximum size and type of the files, and requests are rejected only when these restrictions are not met.

Now I release a new version. Thank you.

@szaimen
Copy link
Contributor

szaimen commented Jan 17, 2024

This is now released with v7.11.0 Beta. Testing and feedback is welcome! See https://github.com/nextcloud/all-in-one#how-to-switch-the-channel

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

3 participants