animina-dating / animina

👫❤️ ANIMINA Dating Platform
https://animina.de
Other
16 stars 6 forks source link

Performance issues while running photos through the ML model with Nx.Serving #491

Closed wintermeyer closed 5 months ago

wintermeyer commented 5 months ago

My setup:

mix ash_postgres.reset 
mix create_dummy_accounts 5
iex -S mix phx.server

Than my Apple M1 laptop gets really warm/hot:

PID    COMMAND      %CPU      TIME     #TH    #WQ  #PORT MEM    PURG   CMPRS
30037  beam.smp     200.2     34:55.92 49/2   0    71    1132M- 0B     346M

Something is not right here. I don't see any results in the database. The system is working like crazy but no result.

wintermeyer commented 5 months ago

Is it possible that we feed the AI with too big images? I remember that the AI only needs a relatively low resolution. But maybe I misread this.

briankariuki commented 5 months ago

Will fix this!

wintermeyer commented 5 months ago

@briankariuki I like the idea of setting up the system that multiple images at once are run to improve the ML performance. But I doubt that this will help with this problem.

Anyhow: When you improve the system by running multiple images at once please make sure that a single image will not stay unprocessed for ever just because there are no other images to process.

wintermeyer commented 5 months ago

Feel free to use convert. That is installed on the production server.

https://fly.io/phoenix-files/resizing-images-using-elixir/

wintermeyer commented 5 months ago

https://huggingface.co/Falconsai/nsfw_image_detection

The images in the pre-training dataset are resized to a resolution of 224x224 pixels, making it suitable for a wide range of image recognition tasks.