livebook-dev / kino

Client-driven interactive widgets for Livebook
Apache License 2.0
372 stars 65 forks source link

Better image support #155

Open josevalim opened 2 years ago

josevalim commented 2 years ago

There are some ideas flying around:

  1. [x] Support Nx.Tensor in Kino.Image by using a custom content type that is loaded into a canvas
  2. [ ] Have a canvas input
  3. [x] Have a camera input
  4. [x] Have a specific image tensor upload, where the image is loaded into a canvas to be converted into pixels (and potentially resized)
cocoa-xu commented 1 year ago

Hi @josevalim, I'd like to add support for camera input if currently no one is working on it. :)

josevalim commented 1 year ago

Yes, please go ahead. Let’s start with camera image first, so there is an explicit click button to take a picture?

cocoa-xu commented 1 year ago

Yeah, I'm thinking something like this:

Screenshot 2022-12-18 at 09 27 32

And, of course, we can probably also make it optional here, something like Kino.Input.image("Image", camera: false).

Linked PR: https://github.com/livebook-dev/livebook/pull/1595