Skip to main content

PyAutoMakerHuman

사람과 관련된 자동화 모듈

주의

이 프로젝트는 아직 개발중입니다 내보내는 API는 언제든지 바뀔 수 있습니다

설치

pip install PyAutoMakerHuman

또는

git clone https://github.com/boa9448/PyAutoMakerHuman.git
cd PyAutoMakerHuman
python setup.py install

사용

데이터셋 폴더 구조

dataset
├─face
└─hand
    ├─paper
    ├─rock
    └─scissors

분류기 학습

import os
import PyAutoMakerHuman as pamh

#데이터셋 경로 지정
dataset_path = os.path.join("dataset", "hand")

#손 검출 임계치 0.7
hand = pamh.HandUtil(min_detection_confidence=0.7)

#데이터셋의 경로를 넘겨주면 사전형 값을 리턴함
data = hand.extract_dataset(dataset_path)
train_data, name = data["data"], data["name"]

trainer = pamh.SvmUtil()
#svm 학습
trainer.train_svm(train_data, name)

#학습된 svm 모델을 myModel폴더에 저장
trainer.save_svm("myModel")

이미지에서 손모양 분류

import cv2
import imutils
import os
import PyAutoMakerHuman as pamh
import random

hand = pamh.HandUtil(min_detection_confidence=0.7)
trainer = pamh.SvmUtil()

#학습된 svm모델을 불러옴
#myModel폴더에 있는 모델과 라벨을 불러옴
trainer.load_svm("myModel")

#이미지를 읽어옴
img_path = "test.jpg"
img = cv2.imread(img_path)

#이미지 리사이즈
img = imutils.resize(img, width=600)
#이미지에서 박스와 랜드마크를 추출함
data_list = hand.extract(img)

color_dict = {}
#이미지에서 탐지를 성공했다면...
if data_list:
    for idx, data in enumerate(data_list):
        landmark_1d = data[1]
        name, proba = trainer.predict([landmark_1d])

        box = data[0]
        color = (0, 0, 0)

        if name in color_dict:
            color = color_dict[name]
        else:
            color = (random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
            color_dict[name] = color


        cv2.putText(img, f"{name} : {proba:.2f}", (box[0], box[1] - 25)
                    , cv2.FONT_HERSHEY_SIMPLEX, 1, color, 2, cv2.LINE_AA)
        cv2.rectangle(img, (box[0], box[1]), (box[0] + box[2], box[1] + box[3])
                        , color, 2)


cv2.imshow("view", img)
cv2.waitKey()
cv2.destroyAllWindows()

추후 개발

간단하게 모델을 학습 시킬 수 있는 GUI도구

GUI도구 미리 둘러보기

패키지 설치 후 python -m PyAutoMakerHuman

Metadata

Release files for PyAutoMakerHuman 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyAutoMakerHuman 1.2.1
File Size Uploaded Provenance
PyAutoMakerHuman-1.2.1.tar.gz 47.9 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for PyAutoMakerHuman 1.2.1
File Interpreter ABI Platform
PyAutoMakerHuman-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 95.7 MB

Release files / PyAutoMakerHuman-1.2.1.tar.gz

Download URL PyAutoMakerHuman-1.2.1.tar.gz
Size 47.9 MB
Tags Source
SHA-256 checksum
How to use checksums
55ce2b8c97918298973746074b3ce95fbb2845a6f7ae6116ad51dd5fc3285f69
BLAKE2b-256 checksum
How to use checksums
3b526047ececbb988012cfdccd5e608410399d630653a38941abd81969aefb86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

Release files / PyAutoMakerHuman-1.2.1-py3-none-any.whl

Download URL PyAutoMakerHuman-1.2.1-py3-none-any.whl
Size 47.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
fb20641792a4bfef2e9900a189f6c27b3c192c7e5cae5798351bc6c32560283d
BLAKE2b-256 checksum
How to use checksums
ff3a9b41720dde0638435d04f732ba382e859bc3f25b2fad28bf8e6f3797262a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

Security for PyAutoMakerHuman 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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