Skip to main content

Computer vision utilities for dataset visualization

Project description

haechan

Computer vision utilities for dataset visualization.

Installation

pip install haechan

Usage

import numpy as np
from PIL import Image, ImageDraw
from haechan import palette, blend, place_label, save_img, save_gif

# Get color palette (VOC-style)
colors = palette()

# Blend image with segmentation mask
img = np.array(Image.open("image.jpg"))
mask = np.array(Image.open("mask.png"))
blended = blend(img, mask, fg=mask > 0)

# Save image (numpy array or PIL Image)
save_img(blended, "output.jpg")

# Place label on mask center
pil_img = Image.fromarray(blended)
draw = ImageDraw.Draw(pil_img)
place_label(draw, mask == 1, text="person", color=(255, 0, 0))

# Save frames as GIF
frames = [Image.open(f"frame{i}.png") for i in range(10)]
save_gif(frames, "output.gif", duration=200)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

haechan-0.1.2.tar.gz (3.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

haechan-0.1.2-py3-none-any.whl (3.0 MB view details)

Uploaded Python 3

File details

Details for the file haechan-0.1.2.tar.gz.

File metadata

  • Download URL: haechan-0.1.2.tar.gz
  • Upload date:
  • Size: 3.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for haechan-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8f19e8d10b2160533ef47c830e11f3648d13947de14b16ca3558cb01df59946f
MD5 f1fa62ad328d26ec67c3c814f183297a
BLAKE2b-256 011068531da5435986066cbe2cb656a274353a1a34a9c4ec2e3ece91eeabc4dc

See more details on using hashes here.

File details

Details for the file haechan-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: haechan-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for haechan-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 891d48e7b048bf10948868ba24de68ed9473336cb283b0d56690ad23dd29f530
MD5 69c627c0dab81273f3ed92dba710b4ad
BLAKE2b-256 8c85a1b73e3c8d72b14f4356bd44aadd9e8e7689671da9ecfce0fd1ba03e8bea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page