Skip to main content

AI Graphics Toolkit

Project description


import cv2
import graphics as g


cl = g.Classifier(model_name="../models/classifier.pth", ctx_id=-1)
src = cv2.imread('27.png', cv2.IMREAD_UNCHANGED)
label = cl.predict(src)


src = cv2.imread('27.png', cv2.IMREAD_UNCHANGED)
ic = g.ImageCrop(model_name="../models/basnet.pth", ctx_id=-1)
image = ic.crop_image(src, (1000, 1000))
bbox = ic.crop_margin(src, (1000, 1000))


src = cv2.imread('27.png', cv2.IMREAD_UNCHANGED)
bbox = g.Graphics.crop_margin(src, thre=220, margin=[10, 10, 10, 10])


src = cv2.imread('27.png', cv2.IMREAD_UNCHANGED)
image = g.Graphics.layer_reflection(src, top=0, down=0.3, transparency=0.15)


src = cv2.imread('27.png', cv2.IMREAD_UNCHANGED)
image = g.Graphics.layer_mask(src)


src = cv2.imread('27.png', cv2.IMREAD_UNCHANGED)
image = g.Graphics.alpha_compose(src, image, x=0, y=0)


python -m pip install --user --upgrade setuptools wheel
python -m pip install --user --upgrade twine
python sdist bdist_wheel

3、在 注册账号 Cachcheng 并上传包

python -m twine upload --repository-url dist/*


Project details

Download files

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

Files for ai-graphics, version 0.1.14
Filename, size File type Python version Upload date Hashes
Filename, size ai_graphics-0.1.14-py3-none-any.whl (32.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size ai-graphics-0.1.14.tar.gz (25.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page