wandb / weave

Weave is a toolkit for developing AI-powered applications, built by Weights & Biases.
https://wandb.me/weave
Apache License 2.0
659 stars 49 forks source link

feat: Add first class Image support for PIL images #2113

Closed tssweeney closed 4 weeks ago

tssweeney commented 1 month ago

Image Support!

@weave.op
def make_image() -> Image.Image:
    return Image.new("RGB", (512, 512), "purple")
Screenshot 2024-08-14 at 13 55 01

This PR adds first class support for PIL images by leveraging the CustomWeaveType pattern. The majority of this PR are tests & improvements to the UI dispatch system such that changes like this will be easier in the future (think Audio/Video/etc..). After this PR, Images (and any custom type) now work in:

Everything works as plain data or saved refs.

And the UI has support for viewing images in:

  1. Calls Table
  2. Call Detail View
  3. Eval Compare Page
  4. Object Detail View
  5. Object List View (Properties)
  6. Dataset Table View (Columns)

As an additional component of this PR, I implemented Dataset Tables supporting having their rows properly serialized.

Followups:

circle-job-mirror[bot] commented 1 month ago

Preview this PR with FeatureBee: https://beta.wandb.ai/?betaVersion=f9b235350aa9a53d08917d33ff6d999b799e4d0e