marcelle icon indicating copy to clipboard operation
marcelle copied to clipboard

imageUpload and webcam sending streams of TensorLike for onnxModel or tfjsModel

Open FrankwaP opened this issue 1 year ago • 3 comments

Hello,

First: thank you for this promising library!

Is your feature request related to a problem? Please describe.

I would like to test MarcelleJS to create a webpage for object detection or semantic segmentation, using a trained model stored in ONNX format. So far I'm just trying to adapt this example: https://github.com/marcellejs/marcelle/tree/main/apps/demos/object-detection/

Since our models do not take input in ImageData format, it seems I would need to use:

const detector = onnxModel({
  inputType: 'generic',
  taskType: 'generic',
});

However both imageUpload and webcam only send streams of images in the ImageData format, so setting up a pipeline between these and detector does not seem possible.

Describe the solution you'd like Both imageUpload and webcam should be able to send streams of images in the ImageData AND TensorLike formats.

Describe alternatives you've considered It might be possible to make a custom prediction model using image in ImageData format as input and use it for the ONNX export. I still haven't found any relevant source for that however.

FrankwaP avatar Mar 23 '23 17:03 FrankwaP