nextcloud / recognize

👁 👂 Smart media tagging for Nextcloud: recognizes faces, objects, landscapes, music genres
https://apps.nextcloud.com/apps/recognize
GNU Affero General Public License v3.0
563 stars 45 forks source link

Support running recognize in a separate container (with GPU support) #1061

Closed SilleBille closed 6 months ago

SilleBille commented 11 months ago

Describe the feature you'd like to request

With the nextcloud/all-in-one container that spawns multiple containers, I'd like to run recognize app in a separate container, that can be used by the nextcloud-aio-nextcloud container. This will let the user provide GPU capabilities to the docker without having to provide that functionality to the whole NC eco-system. It also provides more portability and isolation.

Describe the solution you'd like

A docker container that is exposed through a specific port so that the main nextcloud-aio-nextcloud container can interact with it through the same network nextcloud-aio bridge network.

Describe alternatives you've considered

A docker container that shares all the existing volume and mounts used by nextcloud-aio-nextcloud container in ro format. Completely trying to build a container with CUDA + cuDNN and implement this solution. (I'll keep this issue updated based on the results)

github-actions[bot] commented 11 months ago

Hello :wave:

Thank you for taking the time to open this issue with recognize. I know it's frustrating when software causes problems. You have made the right choice to come here and open an issue to make sure your problem gets looked at and if possible solved. I try to answer all issues and if possible fix all bugs here, but it sometimes takes a while until I get to it. Until then, please be patient. Note also that GitHub is a place where people meet to make software better together. Nobody here is under any obligation to help you, solve your problems or deliver on any expectations or demands you may have, but if enough people come together we can collaborate to make this software better. For everyone. Thus, if you can, you could also look at other issues to see whether you can help other people with your knowledge and experience. If you have coding experience it would also be awesome if you could step up to dive into the code and try to fix the odd bug yourself. Everyone will be thankful for extra helping hands! One last word: If you feel, at any point, like you need to vent, this is not the place for it; you can go to the forum, to twitter or somewhere else. But this is a technical issue tracker, so please make sure to focus on the tech and keep your opinions to yourself. (Also see our Code of Conduct. Really.)

I look forward to working with you on this issue Cheers :blue_heart:

marcelklehr commented 11 months ago

Hi @SilleBille

Nextcloud GmbH is planning to make this happen soon-ish :)

oliverhu commented 10 months ago

+1 upvote to this... especially the integration with aio.

Passaita commented 10 months ago

That wold be a good way to improve nextcloud ecosystem and allow users to install containers that are required.

danieloppenlander commented 10 months ago

Any updates on this? Would be great to have the video tagging and performance benefits. I might have a little dev time to contribute if someone could point me in the right direction.

bugsyb commented 7 months ago

If you're in instant need, there's this mod I've done: https://github.com/bugsyb/recognize_docker/

The way I have it set up is very close if not exactly that what requestor raised - in my case it runs on completely separate system, uses FS via NFS to access files and stores all data in shared Postgres DB.

Use the nvidia-tensor-based if you're fine with some mappings being done there.

marcelklehr commented 7 months ago

Nextcloud GmbH is planning to make this happen soon-ish

Sorry to say, the plans have been scrapped due to lack of engineering time so far. It's still on our list of things that would be nice to have, but it's not scheduled any time soon for now :/

rowanmoul commented 7 months ago

the plans have been scrapped due to lack of engineering time

Are you open to community contributions on this one? If so, it would helpful to have an outline of how you intended to implement it, if one exists.

I'm not sure I will personally have the time, but perhaps someone else does.

marcelklehr commented 7 months ago

I'd be open to community contributions on this.

my rough plan would be not to deviate too much from how the models are run right now. Instead of the Classifier class executing node.js directly, there would be an option in the settings to call out to the recognize External App instead, or perhaps the external app could be auto-detected. The external app would do the same thing as the Classifier class, execute node.js and return the json line results, so they can be processed in the original recognize app. These are the current docs on how App API / External Apps work: https://cloud-py-api.github.io/app_api/index.html

marcelklehr commented 6 months ago

I'm closing this in favor of #73 which is basically the same thing. Upvote there, to make it more likely I get to work on this :)