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

save_images_to_db=false not working #723

Open
ncsibra opened this issue Feb 14, 2022 · 5 comments
Open

save_images_to_db=false not working #723

ncsibra opened this issue Feb 14, 2022 · 5 comments

Comments

@ncsibra
Copy link

ncsibra commented Feb 14, 2022

Describe the bug
I'm testing CompreFace with the provided Docker Compose distribution in the root directory and looks like the save_images_to_db=false option does not work.
The trained faces are still saved to Postgres img table.
Tested with v0.6.1 tag and the latest master.

Based on docker inspect the related configuration option passed correctly to compreface-api.

        "Config": {
            "Hostname": "6a220ba41a7d",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": true,
            "AttachStderr": true,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "POSTGRES_PASSWORD=postgres",
                "POSTGRES_URL=jdbc:postgresql://compreface-postgres-db:5432/frs",
                "SPRING_PROFILES_ACTIVE=dev",
                "API_JAVA_OPTS=-Xmx4g",
                "SAVE_IMAGES_TO_DB=false",
                "POSTGRES_USER=postgres",
                "PATH=/usr/local/openjdk-11/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "LANG=C.UTF-8",
                "JAVA_HOME=/usr/local/openjdk-11",
                "JAVA_VERSION=11.0.8"
            ],
            "Cmd": null,
            "Image": "exadel/compreface-api:0.6.1",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": [
                "sh",
                "-c",
                "java $API_JAVA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -jar /home/app.jar"
            ],
            "OnBuild": null,
            "Labels": {
                "com.docker.compose.config-hash": "b84a70e10ecbe10ad754be77aafdba54fa7a8333dc3ac491f37311ac181f1859",
                "com.docker.compose.container-number": "1",
                "com.docker.compose.depends_on": "compreface-postgres-db",
                "com.docker.compose.image": "sha256:fc2d4ce7b40cc72fa875f8f35dcec35e4e2fa8979e791fea1f69ca40b855d9ba",
                "com.docker.compose.oneoff": "False",
                "com.docker.compose.project": "compreface",
                "com.docker.compose.project.config_files": "/home/ncsibra/dev/tmp/CompreFace/docker-compose.yml",
                "com.docker.compose.project.working_dir": "/home/ncsibra/dev/tmp/CompreFace",
                "com.docker.compose.service": "compreface-api",
                "com.docker.compose.version": "2.2.3",
                "desktop.docker.io/wsl-distro": "Arch"
            }
        },

Here's the original implementation: https://github.com/exadel-inc/CompreFace/pull/163/files#diff-d829967df73c63987fa6772e8f2e0e9b9374ad3df661a20e3931094b1726253fR80
Quickly searching through the code, I can't see the relevant logic in the current codebase, but I'm not a big Java guy. :)

To Reproduce
Steps to reproduce the behavior:

  1. In the root directory .env file set save_images_to_db=false
  2. Run docker compose
  3. Train a new example to a subject
  4. Check the database img table, a new entry will be added and the size of the data in the content column is the same as the uploaded image size

Expected behavior
Do not save the image to the database when save_images_to_db=false

@pospielov
Copy link
Collaborator

Looks like this is a critical bug. I checked the code and this logic was removed during refactoring that was in 0.6.0 version.
If you need this functionality, please use 0.5.1 version.
I will add this bug as critical to 1.0.0 release that we plan to release soon.
I'll update the documentation as well to warn other users.

@ncsibra
Copy link
Author

ncsibra commented Feb 22, 2022

@pospielov Do you have any ETA for 1.0.0?

@pospielov
Copy link
Collaborator

I think we will release this or the next week.

@Ahmedsaber9
Copy link

Hello All
how could I see data stored by CompreFace at my server as files or DB etc?

Thanks

@pospielov
Copy link
Collaborator

All files are stored in compreface-postgres-db container in the PostgreSQL database.
You can expose the port in docker-compose.jml file, you can see how it's done in dev docker-compose.jml:
https://github.com/exadel-inc/CompreFace/blob/master/dev/docker-compose.yml
Then connect to DB using pgadmin or another tool and see all information.

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