purrsong
Installation
pip install purrsong
Start
import purrsong as ps
ps.__version__
>>> 0.1.6
Create Anaconda Environment(Optional)
conda create -n purrsong python=3.6
conda activate purrsong
Requirments
- tensorflow
- opencv-python
- tqdm
- requests
- pandas
- matplotlib
Auto-download-extract-load of datasets, modelsets
Below function automatically download data or models and save locally If data is already exists, returns data directory or model filepath
import purrsong as ps
model_list = ps.list_models() # or ps.list_models(fresh=True)
print(model_list)
ps.load_model('bbs') # or ps.load_model('bbs', fresh=True)
dataset_list = ps.list_datasets() # or ps.list_datasets(fresh=True)
print(dataset_list)
ps.load_dataset('cat') # or ps.load_dataset('cat', fresh=True)
Manipulating cats dataset
You can play with auto downloaded cats dataset by below example.
Try changing factor arg, which will return different size of bounding boxes.
load cats dataset
import purrsong as ps
import matplotlib.pyplot as plt
cats = ps.load_cats()
showing cat image
img = cats[0]['image']
plt.imshow(img)
plt.show()
showing cat image with landmark
img = cats[0]['image']
lmk = cats[0]['landmark']
x, y = lmk.T
plt.imshow(img)
plt.scatter(x, y)
plt.show()
showing cat face image
img = cats.face_img(44) # or img = cats.face_img(idx=44, factor=1.7)
plt.imshow(img)
plt.show()
showing cat left eye image
img = cats.left_eye_img(44) # or img = cats.face_img(idx=44, factor=1.7)
plt.imshow(img)
plt.show()
available data features
import purrsong as ps
cats = ps.load_cats()
cat = cats(0) # or cats(idx=0, factor=1.7)
cat['image'] # cats.image(0)
cat['landmark'] # cats.landmark(0)
cat['face'] # cats.face(0, factor=1.7)
cat['face_bb'] # cats.face_bb(0, factor=1.7)
cat['face_img'] # cats.face_img(0, factor=1.7)
cat['face_lmk'] # cats.face_lmk(0, factor=1.7)
cat['eye'] # cats.eye(0, factor=1.7)
cat['left_eye_bb'] # cats.left_eye_bb(0, factor=1.7)
cat['left_eye_img'] # cats.left_eye_img(0, factor=1.7)
cat['right_eye_bb'] # cats.right_eye_bb(0, factor=1.7)
cat['right_eye_img'] # cats.right_eye_img(0, factor=1.7)
cat['nose'] # cats.nose(0, factor=1.7)
cat['nose_bb'] # cats.nose_bb(0, factor=1.7)
cat['nose_img'] # cats.nose_img(0, factor=1.7)
cat['ear'] # cats.ear(0, factor=1.7)
cat['left_ear_bb'] # cats.left_ear_bb(0, factor=1.7)
cat['left_ear_img'] # cats.left_ear_img(0, factor=1.7)
cat['right_ear_bb'] # cats.right_ear_bb(0, factor=1.7)
cat['right_ear_img'] # cats.right_ear_img(0, factor=1.7)
left dict form is much more intuitive and good
when you have to handle many of features at the same time.
right method way is good when you access specific feature.
Metadata
Release files for purrsong 0.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| purrsong-0.1.9-py3-none-any.whl | Python 3 | none | any | Details |
Release files / purrsong-0.1.9-py3-none-any.whl
| Download URL | purrsong-0.1.9-py3-none-any.whl |
|---|---|
| Size | 23.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dc3cb9be972f50db219a62ffb6a0b0f71e63bdc35b4100c2a9c384443158a4c7
|
|
BLAKE2b-256 checksum How to use checksums |
f3f8bab63207bc54c55377c3df2d2ab995047759e34ce6493f6ff245ad72dbb4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.6.9
|
Security for purrsong 0.1.9
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.