/datagrid

DataGrid for Python mixed-media tables

Primary LanguagePythonApache License 2.0Apache-2.0

datagrid

Create a datagrid of mixed-media items, and log to comet.com.

Installation

pip install datagrid

Example

The following demo program will log 100 random images, scores, and categories:

from comet_ml import start
from datagrid import DataGrid, Image

import random
from PIL import Image as PImage
import requests

experiment = start(project_name="datagrids")

categories = ["sunset", "landscape", "water", "tree", "city"]

dg = DataGrid(
    columns=["Image", "Score", "Category"],
    name="Demo"
)
url = "https://picsum.photos/200/300"
for i in range(100):
    im = PImage.open(requests.get(url, stream=True).raw)
    category = random.choice(categories)
    score = random.random()
    image = Image(im, metadata={"category": category, "score": score})
    dg.append([image, score, category])

dg.log(experiment)
experiment.end()

Visualization

image

Log into comet.com to see results.