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, label, save_img, save_gif

# Get color palette (VOC-style, 254 colors)
colors = palette()  # or get_colors(num_classes=100) for custom count

# 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)
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.4.tar.gz (1.2 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.4-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: haechan-0.1.4.tar.gz
  • Upload date:
  • Size: 1.2 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.4.tar.gz
Algorithm Hash digest
SHA256 3880c14389480a8155776f46902e605b6632386bfa8973b8f67dd0687405a8a9
MD5 d8575516f536eb9c9d915148ee848868
BLAKE2b-256 ad59187ba261263be22b8934c848b84746685d133ec3a2b9afe6376f4176e622

See more details on using hashes here.

File details

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

File metadata

  • Download URL: haechan-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 1.2 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c263f18303377ebdc4198ca2fd59c209249039ffdcd476bfd07bc002449926ce
MD5 f469abd64b2039f469a836f31fdeb7e0
BLAKE2b-256 a87e9f789d6db2b0ddd960f8601306ea6bf8958a08ab4c5bfa60c0dc9c72d841

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