Skip to main content

A Rust-based library from vmlab

Project description

vmlab-py-package

pypi link : vmlab_py

Rust 기반으로 구현된 Python 패키지 vmlab-py

목표

  • Native 언어로 구현하여 python내에서 성능 효율성 높이기

프로젝트 정보

설치

pip install vmlab-py==0.1.6

모듈에 포함된 함수

1. a2ev1_melspectrogram

  • 설명: Audio2Exp V1 모델을 위한 Mel Spectrogram 생성 (샘플레이트가 다를 경우 16000으로 변환)
  • 입력:
    • wav (numpy.ndarray): numpy.ndarray 형태의 WAV 데이터
    • sample_rate (u32): wav 의 sample rate
  • 출력:
    • Mel Spectrogram을 바이트 리스트로 반환

2. a2ev2_melspectrogram

  • 설명: Audio2Exp V2 모델을 위한 Mel Spectrogram 생성 (샘플레이트가 다를 경우 16000으로 변환)
  • 입력:
    • wav (numpy.ndarray): numpy.ndarray 형태의 WAV 데이터
    • sample_rate (u32): wav 의 sample rate
  • 출력:
    • Mel Spectrogram을 바이트 리스트로 반환

3. dummy_func

  • 설명: 초기화를 위한 더미 함수
  • 출력:
    • 더미 값 0 반환

4. reconstruct_mask

  • 설명: CompactMaskModel로부터 그레이스케일 마스크 복원
  • 입력:
    • bytes (PyBytes): CompactMaskModel의 직렬화된 데이터
    • width (usize): 출력 이미지의 너비
    • height (usize): 출력 이미지의 높이
    • scale (Tuple(f32, str)): 마스크의 크기 조정 비율 및 리사이징 필터 타입 (옵션)
      • FilterType:
        • NEAREST: "nearest" 또는 "lowest"
        • LINEAR: "linear", "triangle", "low"
        • CATMULLROM: "catmullrom", "cubic", "medium"
        • GAUSSIAN: "gaussian", "high"
        • LANZOS: "lanzos", "highest"
  • 출력:
    • 복원된 마스크를 numpy.ndarray 형태로 반환 (H, W)

Publish

Requirements

pip install maturin

Build the python package

maturin build --release

Test in locally

pip install target/wheels/{GENERATED_WHEELS_NAME}.whl

Publish to PyPI

maturin publish

Build for arm and upload file

manylinux에서 빌드. (manylinux는 다양한 리눅스 배포판에서 동작할 수 있는 **바이너리 파이썬 패키지(whl 파일)**를 제공하기 위해 만들어짐.)

Dockerfile에서 빌드 및 업로드까지 해결. ( FROM quay.io/pypa/manylinux_2_28_aarch64 )

Build (on x86 host):

  • 변수 PASS에 토큰 입력 필요
docker buildx build --platform linux/arm64 --build-arg PASS=<token> -t maturin-arm-builder .

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

vmlab_py-0.1.16.tar.gz (23.5 kB view details)

Uploaded Source

Built Distribution

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

vmlab_py-0.1.16-cp312-cp312-manylinux_2_34_x86_64.whl (620.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

File details

Details for the file vmlab_py-0.1.16.tar.gz.

File metadata

  • Download URL: vmlab_py-0.1.16.tar.gz
  • Upload date:
  • Size: 23.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.1

File hashes

Hashes for vmlab_py-0.1.16.tar.gz
Algorithm Hash digest
SHA256 4b998c273245f85c83a4f3c89f04b6aac4b79c664e625313045cb2abac3f240f
MD5 33fdbdb71905092442ac6059f1bfb0bf
BLAKE2b-256 73280d8dabf21429873f3fa853e7d5d343f54bc7649322c71975578eecf8a3dd

See more details on using hashes here.

File details

Details for the file vmlab_py-0.1.16-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for vmlab_py-0.1.16-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ddcf19e88b0fc6cdfa013fed1b2de44995596ff3bb58b4f330e49121fd1aa2a9
MD5 3d41e8c6fa57a2882824c4eae167aa15
BLAKE2b-256 00cbcc661ad92ab1699958fce5cbb4137e322da742446d0fef81c5a678a5d6af

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