skrashevich / double-take

Unified UI and API for processing and training images for facial recognition.
https://hub.docker.com/r/skrashevich/double-take
MIT License
526 stars 25 forks source link

[BUG] Pictures in portrait mode are not rendered correctly. Maybe causing an issue with training #118

Closed ultratoto14 closed 1 year ago

ultratoto14 commented 1 year ago

I went from original double-take to yours and found out that all my pictures coming from my phone (Samsung Galaxy Note 20 Ultra) in portrait mode are displayed in landscape mode in the UI.

I thought it was not a problem but when I was trying CodeProject.AI, the logs shows no face detected on these images, Just added one picture taken in landscape mode and CodeProject.AI detected the faces.

Version of Double Take 1.13.11.3

Expected behavior Portrait photo should be sent/viewed as portrait

Screenshots 2023-09-22_15-23-20

Hardware

skrashevich commented 1 year ago

Do you upload photos directly from your phone, or do you transfer them to PC first?

ultratoto14 commented 1 year ago

Hi, I uploaded from phone directly, using google chrome.

skrashevich commented 1 year ago

please, provide an example of problem photo file

ultratoto14 commented 1 year ago

Here is an example picture 20230925_085408 And the view in double-take: Screenshot_20230925_085514_Chrome

skrashevich commented 1 year ago

thx. I was able to reproduce this issue. fixed in current latest beta build. will be included in next release

ultratoto14 commented 1 year ago

Hi @skrashevich , just tested the latest beta and it seems that it works most of the time. When I tried to retrain all the files sent from my phone, it's really slow to process and most of them received a 413 from compreface:

172.29.36.1 - - [25/Sep/2023:06:59:40 -0700] "POST /api/v1/recognition/faces?subject=emile HTTP/1.1" 201 91 "-" "axios/1.5.0" 2023/09/25 07:00:29 [error] 106#106: *651862 client intended to send too large body: 5338079 bytes, client: 172.29.36.1, server: ui, request: "POST /api/v1/recognition/faces?subject=emile HTTP/1.1", host: "192.168.15.4:8000" 172.29.36.1 - - [25/Sep/2023:07:00:30 -0700] "POST /api/v1/recognition/faces?subject=emile HTTP/1.1" 413 192 "-" "axios/1.5.0" 2023/09/25 07:03:16 [error] 106#106: *651863 client intended to send too large body: 5206261 bytes, client: 172.29.36.1, server: ui, request: "POST /api/v1/recognition/faces?subject=jade HTTP/1.1", host: "192.168.15.4:8000" 172.29.36.1 - - [25/Sep/2023:07:03:16 -0700] "POST /api/v1/recognition/faces?subject=jade HTTP/1.1" 413 192 "-" "axios/1.5.0" 2023/09/25 07:03:16 [error] 106#106: *651864 client intended to send too large body: 5139979 bytes, client: 172.29.36.1, server: ui, request: "POST /api/v1/recognition/faces?subject=jade HTTP/1.1", host: "192.168.15.4:8000" 172.29.36.1 - - [25/Sep/2023:07:03:16 -0700] "POST /api/v1/recognition/faces?subject=jade HTTP/1.1" 413 192 "-" "axios/1.5.0" 2023/09/25 07:03:16 [error] 106#106: *651865 client intended to send too large body: 5130935 bytes, client: 172.29.36.1, server: ui, request: "POST /api/v1/recognition/faces?subject=jade HTTP/1.1", host: "192.168.15.4:8000" 172.29.36.1 - - [25/Sep/2023:07:03:16 -0700] "POST /api/v1/recognition/faces?subject=jade HTTP/1.1" 413 192 "-" "axios/1.5.0"

As it seems that you changed the image orientation, the picture data size became too big.

skrashevich commented 1 year ago

it's not a double-take problem. look like you have nginx in front of compreface?

ultratoto14 commented 1 year ago

I use the single image of compreface:

  compreface:
    container_name: compreface
    restart: always
    image: exadel/compreface:1.0.0-arcface-r100-gpu

Effectively, when I go inside the compreface docker container, it seems to run an nginx instance. The problem remains the same, the original picture go through double-take to compreface with the orientation problem. With you fix, some pictures are going through with the right orientation but in some case, the rotated picture is too large for compreface because it's way bigger than the original picture.

skrashevich commented 1 year ago

this is limitation in compreface single-image: https://github.com/exadel-inc/CompreFace/blob/4d826e53bdbe82c2a2ed2229aa27785cdf732247/custom-builds/Single-Docker-File/nginx.conf#L19

for increase this limit you can, for example, download nginx.conf to you host, change this property and mount it to compreface container (docker run .... -v path_to_modified_nginxconf:/etc/nginx/conf.d/nginx.conf)

anyway, this is compreface issue, not double-take

atv2016 commented 1 year ago

thx. I was able to reproduce this issue. fixed in current latest beta build. will be included in next release

@skrashevich I have the same issue all of a sudden (auto-rotation). Was wondering how this happened, never had an issue with it before. Did we include some new dependancy or something?

Thanks for fixing.

How do i install the beta from the add-on store ? Anyway of doing this ? Or can we push the new release?

skrashevich commented 1 year ago

fixed in v1.13.11.4 release