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

Uploaded Python 3

File details

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

File metadata

  • Download URL: haechan-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 93b82706de35b59df76cdf7b2340a59ec317e243a433038644c31851ae3e772a
MD5 71d6d9cbe5b3168cb9a6ab4eda4b87cc
BLAKE2b-256 d51e9515c0e470b5b89b5fb03b14990bbb8059ff10e5f6656c67561c6baa7565

See more details on using hashes here.

File details

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

File metadata

  • Download URL: haechan-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6eb292e6db57d65e617f3077d2923dc72daff563bbf51e6e2838a3c097b913e
MD5 e18c69718fc4f422cf93f5f2a8f36e93
BLAKE2b-256 06b02b6be077f6669cab8769687478d0d4db14b05b6ed2b1ae3b7e3b38201213

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