immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
52.23k stars 2.77k forks source link

Twins Photos recognized as one person #14137

Closed mlinko6 closed 6 days ago

mlinko6 commented 6 days ago

The bug

Twins Photos recognized as one person, I have a twin brother and our faces are not the same :-), but even on the same photos the Immich doesn't "recognize" that we are two different persons:

image

The OS that Immich Server is running on

Synology NAS Docker

Version of Immich Server

1.120.2

Version of Immich Mobile App

1.0.0

Platform with the issue

Your docker-compose.yml content

services:
  immich-redis:
    image: redis
    container_name: immich-redis
    hostname: immich-redis
    security_opt:
      - no-new-privileges:true
    healthcheck:
      test: ["CMD-SHELL", "redis-cli ping || exit 1"]
    user: 1026:100
    environment:
      - TZ=Europe/Vienna
    volumes:
      - /volume1/docker/immich/redis:/data:rw
    networks:
      manual: 
        ipv4_address: 172.18.0.31
    restart: on-failure:5

  immich-db:
    image: tensorchord/pgvecto-rs:pg16-v0.2.0
    container_name: immich-db
    hostname: immich-db
    security_opt:
      - no-new-privileges:true
    healthcheck:
      test: ["CMD", "pg_isready", "-q", "-d", "immich", "-U", "immichuser"]
      interval: 10s
      timeout: 5s
      retries: 5
    volumes:
      - /volume1/docker/immich/db:/var/lib/postgresql/data:rw
    environment:
      - TZ=Europe/Vienna
      - POSTGRES_DB=immich
      - POSTGRES_USER=xxxxxx
      - POSTGRES_PASSWORD=xxxxxx
    networks:
      manual: 
        ipv4_address: 172.18.0.32
    restart: on-failure:5

  immich-server:
    image: ghcr.io/immich-app/immich-server:release
    container_name: immich-server
    hostname: immich-server
    user: 1026:100
    security_opt:
      - no-new-privileges:true
    env_file:
      - stack.env
    ports:
      - 8212:2283
    volumes:
      - /volume1/docker/immich/upload:/usr/src/app/upload:rw
      - /volume1/homes/Rocky/Photos/MobileBackup:/volume1/homes/Rocky/Photos/MobileBackup:ro
      - /volume1/homes/Nastja/Photos:/volume1/homes/Nastja/Photos:ro
      - /volume1/photo:/volume1/photo:ro      
    networks:
      manual: 
        ipv4_address: 172.18.0.33
    restart: on-failure:5
    depends_on:
      immich-redis:
        condition: service_healthy
      immich-db:
        condition: service_started

  immich-machine-learning:
    image: ghcr.io/immich-app/immich-machine-learning:release
    container_name: immich-learning
    hostname: immich-machine-learning
    user: 1026:100
    security_opt:
      - no-new-privileges:true
    env_file:
      - stack.env
    volumes:
      - /volume1/docker/immich/upload:/usr/src/app/upload:rw
      - /volume1/docker/immich/cache:/cache:rw
      - /volume1/docker/immich/matplotlib:/matplotlib:rw
    environment:
      - MPLCONFIGDIR=/matplotlib
    networks:
      manual: 
        ipv4_address: 172.18.0.34
    restart: on-failure:5
    depends_on:
      immich-db:
        condition: service_started

networks:
  manual:
    external: true

Your .env content

NODE_ENV=production
TZ=Europe/Bucharest
###################################################################################
# Database
###################################################################################

DB_HOSTNAME=immich-db
DB_USERNAME=xxxxxx
DB_PASSWORD=xxxxxx
DB_DATABASE_NAME=immich

# Optional Database settings:
# DB_PORT=5432

###################################################################################
# Redis
###################################################################################

REDIS_HOSTNAME=immich-redis

# Optional Redis settings:
# REDIS_PORT=6379
# REDIS_DBINDEX=0
# REDIS_PASSWORD=
# REDIS_SOCKET=

###################################################################################
# Log message level - [simple|verbose]
###################################################################################

LOG_LEVEL=log

###################################################################################
# JWT SECRET
###################################################################################

# This JWT_SECRET is used to sign the authentication keys for user login
# You should set it to a long randomly generated value
# You can use this command to generate one: openssl rand -base64 128
JWT_SECRET=xxxxxxx

###################################################################################
# Reverse Geocoding
####################################################################################

# DISABLE_REVERSE_GEOCODING=false

# Reverse geocoding is done locally which has a small impact on memory usage
# This memory usage can be altered by changing the REVERSE_GEOCODING_PRECISION variable
# This ranges from 0-3 with 3 being the most precise
# 3 - Cities > 500 population: ~200MB RAM
# 2 - Cities > 1000 population: ~150MB RAM
# 1 - Cities > 5000 population: ~80MB RAM
# 0 - Cities > 15000 population: ~40MB RAM

DISABLE_REVERSE_GEOCODING=false
REVERSE_GEOCODING_PRECISION=3

####################################################################################
# WEB - Optional
####################################################################################

# Custom message on the login page, should be written in HTML form.
# For example PUBLIC_LOGIN_PAGE_MESSAGE="This is a demo instance of Immich.<br><br>Email: <i>demo@demo.de</i><br>Password: <i>demo</i>"

PUBLIC_LOGIN_PAGE_MESSAGE=

####################################################################################
# Alternative Service Addresses - Optional
#
# This is an advanced feature for users who may be running their immich services on different hosts.
# It will not change which address or port that services bind to within their containers, but it will change where other services look for their peers.
# Note: immich-microservices is bound to 3002, but no references are made
####################################################################################

IMMICH_WEB_URL=http://immich-web:3000
IMMICH_SERVER_URL=http://immich-server:3001
IMMICH_MACHINE_LEARNING_URL=http://immich-machine-learning:3003

####################################################################################
# OAuth Setting - Optional
#
# These setting will enable OAuth login for your instance of Immich
# Folow the instructions in the page https://immich.app/docs/usage/oauth to set up your OAuth provider
####################################################################################

# OAUTH_ENABLED=false
# OAUTH_ISSUER_URL=
# OAUTH_CLIENT_ID=
# OAUTH_CLIENT_SECRET=
# OAUTH_BUTTON_TEXT=Login with OAuth
# OAUTH_AUTO_REGISTER=true
# OAUTH_SCOPE="openid profile email"

Reproduction steps

1. 2. 3. ...

Relevant log output

No response

Additional information

No response

bo0tzz commented 6 days ago

This is currently working as expected; there's no way for the computer to differentiate between twins or for example someone reflected in a mirror. Also see #12922

mlinko6 commented 6 days ago

This is currently working as expected; there's no way for the computer to differentiate between twins or for example someone reflected in a mirror. Also see #12922

Also the Synology Photos recognizes the difference and I think that the Immich ML is far better than that from Synology... So sorry if I don't agree with the answer that the faces are identical and the software can't recognise it...

Screenshot 2024-11-14 090109

Screenshot 2024-11-14 124332

A clear example of what I'm talking about... The print screen is from Synology Photos.

I'm ok with the option, that at least I can "flag" one of the faces as "wrong" or assign a new name to it so the software would maybe check that these aren't the same faces especially on the same photo.

How can I "untag" a double face recognition on a single photo to "show" the ML Module that this are 2 different people? At least that would be the a big help...

mlinko6 commented 5 days ago

@bo0tzz One more question, if I may... Wouldn't it be better that in case AI detects 2 similar or identical faces, it should "think" that these are 2 different persons instead to think that it is a mirror image?

Wouldn't it be better that in case AI detects 2 similar or identical faces on the same photo, it should "think" that these are 2 different persons instead to think that it is a mirror image? For example the Synology Photos does see the difference, but the app is so slow that I'm not using it.

The app is lightyears ahead from the app that Synology uses and I would love to use it primarily but I just don't want to go throug 7000+ photos of me and my brother to manually edit the faces...

Thank you!

KR Rok

mattheys commented 1 day ago

What is your facial recognition settings set to? I had issues where my two children get mixed up despite being 3 years apart so I tried for a more aggressive detection score. I now have to merge lots of people but I prefer that to putting people together that don't belong as you can't split them.

https://immich.app/docs/features/facial-recognition/#maximum-recognition-distance

The default works well for most people, but it may be worth lowering it if the library has twins or otherwise very similar looking people.

mlinko6 commented 1 day ago

What is your facial recognition settings set to? I had issues where my two children get mixed up despite being 3 years apart so I tried for a more aggressive detection score. I now have to merge lots of people but I prefer that to putting people together that don't belong as you can't split them.

https://immich.app/docs/features/facial-recognition/#maximum-recognition-distance

The default works well for most people, but it may be worth lowering it if the library has twins or otherwise very similar looking people.

The face recognitions settings are default:

Screenshot 2024-11-18 120733 Screenshot 2024-11-18 120711

mattheys commented 1 day ago

I set my Max Recognition Distance to 0.4. It's a pain though as you then need to rescan all the photos losing any tagging you've already done. You may also end up with 1 person split over multiple detections and have to merge them, and this might happen for many people. I've had to merge 5 copies of one son into 1, 4 of the other son, 4 of my wife and several of me. It might be faster than trying to manually split them apart.

Be warned though, it's a one way process, once you change that setting and rescan all your photos, you are back at square 1 with no way of going back. If you do decide to do it, I'd maybe have a play with the settings and get something that appears to work well before retagging lots of people.