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

Uploaded Python 3

File details

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

File metadata

  • Download URL: haechan-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 78ebcdc466cf34fcd686c17c2655a690fc556f1e74e10353aca8d847180607ac
MD5 570e6e686c43282f9e6a65c54d3696d6
BLAKE2b-256 068ba81c7292aed16b5fc618d1a68c8f214d7519b6ce8297ed8377c521f2a45b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: haechan-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5733d794807185d89aaf1236cf9472a62a08a300bb05bfbf85683a6b19f56364
MD5 a452c1958ecdee3ab13187f000658bdb
BLAKE2b-256 b00010922f4fd2005a27021b84f31f5d2b24070b2972ff83fbc56bf20a12bde9

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