Skip to main content

purrsong

Project description

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.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

purrsong-0.1.9-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

Details for the file purrsong-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: purrsong-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 23.6 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for purrsong-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 dc3cb9be972f50db219a62ffb6a0b0f71e63bdc35b4100c2a9c384443158a4c7
MD5 b6c1c8aa0d6d78f7fb24a994daa24455
BLAKE2b-256 f3f8bab63207bc54c55377c3df2d2ab995047759e34ce6493f6ff245ad72dbb4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page