Essentially by converting richzhang's pytorch colorizer to CoreML.
One can embed this in a any iOS/macOS/visionOS app and colorize old b&w images
- Essentialy this is a pytorch model ECCV16Colorizer that has been converted to CoreML
- Convert the
UIImage
to aMLShapedArray<Float>
[1, 3, 512, 512] shape - Then convert to same to Lab color space array [1, 1, 512, 512] shape
- Use this array's 'L' part to predict the 'ab' part of the image's Lab color Space Image
- We get an
MLShapedArray<Float>
[1, 2, 512, 512] then using the original 'L' array we can combine and get the Lab of the predicted Image - Convert back to RGB space and convert the array to
UIImage
.