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

Uploaded Python 3

File details

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

File metadata

  • Download URL: haechan-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 09cc8e73b5eb1c410d2bdbfff782aed3ee5ba02820480d595fc771e2abb03dbe
MD5 c4582cbabdab5f1f29255d3c1b663b87
BLAKE2b-256 9e1bd3053b3ca1f94aa2ae7b29307cb037a16e7ff90ddad41e9eebe87d80792b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: haechan-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8dee1e6ab78f47d0869a3fbb8f3c8521a1ba576ab392a7c4696a0e883d982093
MD5 e98fa1910d7fbba61a9d645d46f994a1
BLAKE2b-256 8dcc402ba4691b1200db1196e81d92a2ae6048f1188c8ee6373ffd2953cba157

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