pymlup icon indicating copy to clipboard operation
pymlup copied to clipboard

[Feature] Add the ability to work with images

Open nxexox opened this issue 2 years ago • 0 comments
trafficstars

Problem

I can only create applications that take already arrays of primitives and return primitive structures. But if I want to send a picture, I need to preprocess it into an array of numbers and send it. It would be cool to add data transformers for images and vice versa. This will allow the use of models that accept images as input and models that produce images as output.

Examples

Config file:

...
ml:
    data_transformer_for_predict: "mlup.ml.data_transformers.image_data_transformer.ImageJPGDataTransformer"
    data_transformer_for_predicted: "mlup.ml.data_transformers.image_data_transformer.ImageJPGDataTransformer"
web:
    inner_data_type: "file". # Default is primitive
request.post("http://0.0.0.0:8009/predict", files={'upload_file': open('image.jpg', 'rb')})

nxexox avatar Oct 23 '23 15:10 nxexox