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

Uploaded Python 3

File details

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

File metadata

  • Download URL: haechan-0.1.6.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.6.tar.gz
Algorithm Hash digest
SHA256 dd653037f72d8185c2443e65d8262a05c94678c0a469ce2071b8fb4771fee0a2
MD5 c47df24b1fd59368e5aa7e5ecf3efa3b
BLAKE2b-256 c324261aeef7719bbaa17f6a6b6c25f931ae8e07e560979f97c8c75b615575b3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: haechan-0.1.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 ddbede40f3dee0390a629c364e875ddd9fc56439cce67c557c34fc1ecab196d4
MD5 92365451bb1ef57c78ac24fff5295d60
BLAKE2b-256 ce2c78dba3d2478113aaa211fabd700729751374b00993fdacaae6e8152bb0f1

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