Skip to main content

face-parser

1. Face Segmentation

1.1. BiSeNet

from visage.bisenet import BiSeNetFaceParser
from visage.visualize import apply_colormap

img = load_img()  # torch.Tensor [3, H, W] in range [-1, 1]

face_parser = BiSeNetFaceParser()
segmentation_mask = face_parser.parse(img)

# Plotting
segmentation_mask_colored = apply_colormap(segmentation_mask)  # Colorizes each class with a distinct color for better viewing
plt.imshow(segmentation_mask_colored)

2. Face Bounding Boxes

2.1. FaceBoxesV2

from visage.bounding_boxes.face_boxes_v2 import FaceBoxesV2

img = load_img()  # np.ndarray [H, W, 3] in range [0, 255]

detector = FaceBoxesV2()
detected_bboxes = detector.detect(img)

# Plotting
cv2.rectangle(img, detected_bboxes[0].get_point1(), detected_bboxes[0].get_point2(), (255, 0, 0), 10)
plt.imshow(img)

3. Facial Landmarks

3.1. PIPNet

from visage.landmark_detection.pipnet import PIPNet

img = load_img()  # np.ndarray [H, W, 3] in range [0, 255]
detected_bboxes = ...  # <- from step 2.

pip_net = PIPNet()
landmarks = pip_net.forward(img, detected_bboxes[0])

# Plotting
for x, y in landmarks:
    cv2.circle(img, (int(x), int(y)), 5, (255, 0, 0), -1)

plt.imshow(img)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

visage-0.2.2.tar.gz (124.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

visage-0.2.2-py3-none-any.whl (135.0 kB view details)

Uploaded Python 3

File details

Details for the file visage-0.2.2.tar.gz.

File metadata

  • Download URL: visage-0.2.2.tar.gz
  • Upload date:
  • Size: 124.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.7

File hashes

Hashes for visage-0.2.2.tar.gz
Algorithm Hash digest
SHA256 fcb947e7a6b2438ca6b75bc893dde868cdb7acc7dee3722942ecd421e5bf19ba
MD5 4b76b2b894b05c68e80890ed98496a50
BLAKE2b-256 ae032df12b51bd002cd45280f0cb89b60ebd2da6f73c53b87d73934579365c52

See more details on using hashes here.

File details

Details for the file visage-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: visage-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 135.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.7

File hashes

Hashes for visage-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 03d65f72b01bd3386af1efdd420741e84eb7ed0c289ae0977fd7ddf49f4918ca
MD5 1308a6d27ef367901392ec87d3309356
BLAKE2b-256 bf3f5a92793e0916d809f28f2a5c3aba45c358bbd57653b21b035daaf5347be6

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.18

1 file

0.2.17

1 file

0.2.16

1 file

0.2.15

1 file

0.2.14

1 file

0.2.13

1 file

0.2.12

1 file

0.2.11

1 file

0.2.10

1 file

0.2.8

1 file

0.2.7

1 file

0.2.6

1 file

This release

0.2.2 This release

2 files

0.2.1

1 file

0.2.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page