{"by":"mattismegevand","descendants":38,"id":39821632,"kids":[39822344,39826412,39822011,39825363,39823605,39823573,39826652,39822557,39822120,39825137,39822861,39823782,39825929,39822400,39822028,39824337,39822568],"score":175,"text":"Hi HN, I built (<a href=\"https:&#x2F;&#x2F;invertornot.com\" rel=\"nofollow\">https:&#x2F;&#x2F;invertornot.com</a>) it&#x27;s an API that can predict whether an image will look good&#x2F;bad while inverted. This is particularly useful for images in dark-mode as you can now safely invert them.<p>The conservative solution to adapt images for dark-mode consist in dimming the image, however there is a lot of images that can be inverted (graph for example). Using deep learning we can avoid heuristics and obtain a much more reliable solution.<p>The API uses an EfficientNet pre-trained model fine-tuned on a custom dataset (1.1k samples). EfficientNet was chosen as it was pre-trained and offered the best performance for its size.<p>The trained model is very small (16MB) which means you can easily run your own instance. This problem is very simple for deep learning as it&#x27;s a simple binary classification.<p>For this project training the model wasn&#x27;t the challenge as most of the time was spent on the construction of the dataset.<p>For the API I&#x27;m using FastAPI, Redis and ONNX Runtime to run the model. The API can be used by posting the images to the API, using URL and using SHA-1 for already processed images.<p>The API is free and open-sourced (<a href=\"http:&#x2F;&#x2F;github.com&#x2F;mattismegevand&#x2F;invertornot\">http:&#x2F;&#x2F;github.com&#x2F;mattismegevand&#x2F;invertornot</a>).","time":1711403372,"title":"Show HN: Invertornot.com – API to enhance your images in dark-mode","type":"story","url":"https://invertornot.com"}