codeproject / CodeProject.AI-Server

CodeProject.AI Server is a self contained service that software developers can include in, and distribute with, their applications in order to augment their apps with the power of AI.
Other
565 stars 135 forks source link

Face recognition with CUDA stopped working v1.6.6.0 #24

Closed elad-bar closed 1 year ago

elad-bar commented 1 year ago

Area of Concern

Upgrading to 1.6.6.0 caused face recognition with CUDA stopped working, configuration was updated but it presented that the module loaded without CUDA and didn't accept new requests.

Reverted to 1.6.5.0 and it's working.

Your System (please complete the following information):

matthewDDennis commented 1 year ago

Could you please include the errors that are being displayed to help me narrow down the cause of your issue.

Thanks, Matthew

elad-bar commented 1 year ago

no errors, just not processing, in the web page it presented all the modules, the face reco module enabled on cpu, trying to change it to gpu doing nothing

matthewDDennis commented 1 year ago

I have found why the GPU wasn't enabled. It had been disabled in the modulesettings.docker.json file and another bug prevented it from being enabled. I fix this for the next release.

You say it is not responding to new requests. What is making the requests? What is the command you are using to start the docker image?

elad-bar commented 1 year ago

I'm using it since v1.5.6.2, I'm using Shinobi Video NVR, I wrote the plugin of it connects to DeepStack, After switching to your solution there were almost no adjustements as the request / response and endpoints are the same (except one property was available in DeepStack and not available here).

docker compose:

version: "3.9"

services:
  codeproject-ai-server:
    image: codeproject/ai-server:gpu
    container_name: codeproject-ai-server
    hostname: codeproject-ai-server
    restart: unless-stopped
    runtime: nvidia
    command:
      - --Modules:BackgroundRemover:Activate=False
      - --Modules:BackgroundRemoval:Activate=False
      - --Modules:CustomDetection:Activate=False
      - --Modules:CustomObjectDetection:Activate=False
      - --Modules:PortraitFilter:Activate=False
      - --Modules:SceneClassification:Activate=False
      - --Modules:SceneClassification:EnvironmentVariables:VISION-SCENE=False
      - --Modules:VisionObjectDetection:Activate=False
      - --Modules:VisionObjectDetection:EnvironmentVariables:VISION-DETECTION=False
      - --Modules:FaceProcessing:Activate=True
      - --Modules:FaceProcessing:EnvironmentVariables:VISION-FACE=True
      - --Modules:FaceProcessing:EnvironmentVariables:MODE=High
      - --Modules:FaceProcessing:EnvironmentVariables:USE_CUDA=True
    env_file:
      - ../env/common.env
      - ../env/codeproject-ai-server.env
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
      - $PWD/codeproject-ai-server/data:/usr/share/CodeProject/AI
    ports:
      - 5000:5000

environment variables:

CPAI_ERRLOG_APIKEY=

request is simple nodejs request to the server according to the guideline, nothing change over there

elad-bar commented 1 year ago

is there any progress with that issue?

ChrisMaunder commented 1 year ago

Actually we were waiting on you to see if it was now working with the latest release.

Just to clarify a bit: you say Face recognition isn't working, but does that mean Face detection is working, but it just can't recognise someone? If that's the case then please ensure the /usr/share/CodeProject/AI folder has write access for the server, and check that their is a faceembedding.db database in that folder.

elad-bar commented 1 year ago

It was fixed in later version and now it is working, I removed all settings and reconfigured it from scratch from the UI, will close the issue.