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.5.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.5-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: haechan-0.1.5.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.5.tar.gz
Algorithm Hash digest
SHA256 31d39ed8e1577846398e8a078d9d4e9d07308726b57d03d7a385914eeda5b4e3
MD5 75c606dcfa11ca29d90d94f46ae74515
BLAKE2b-256 73ae16439c25e0ef013e1271d44ddb362722216c68ef515297a465c0194f2086

See more details on using hashes here.

File details

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

File metadata

  • Download URL: haechan-0.1.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 728842a28f907312e725993ff3ea04a20dc15de5328a395bc464cf82700aaa58
MD5 0876a00edc33d4339e8a6aceb9ec5b98
BLAKE2b-256 55e35ae53232b3f594fb2af1fc30cb79d8611d0be6724a98f5c8f6b65631e7f0

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