pyshine
A collection of simply yet high level utilities for Python.
Installation
Installing dependencies
Provided the below python packages are installed, pyshine is completely pip installable.
Installing pyshine
pip install pyshine
To upgrade to the newest version
pip install --upgrade pyshine
pyshine.putBText()
putBText(): Put Background Box with Text
Inputs:
img: cv2 image img
text_offset_x, text_offset_x: X,Y location of text start
vspace, hspace: Vertical and Horizontal space between text and box boundries
font_scale: Font size
background_RGB: Background R,G,B color
text_RGB: Text R,G,B color
font: Font Style e.g. cv2.FONT_HERSHEY_DUPLEX,cv2.FONT_HERSHEY_SIMPLEX,cv2.FONT_HERSHEY_PLAIN,cv2.FONT_HERSHEY_COMPLEX
cv2.FONT_HERSHEY_TRIPLEX, etc
thickness: Thickness of the text font
alpha: Opacity 0~1 of the box around text
gamma: 0 by default
Output:
img: CV2 image with text and background
usage
import pyshine as ps
import cv2
image = cv2.imread('lena.jpg')
text = 'HELLO WORLD!'
image = ps.putBText(image,text,text_offset_x=20,text_offset_y=20,vspace=10,hspace=10, font_scale=1.0,background_RGB=(228,225,222),text_RGB=(1,1,1))
cv2.imshow('Output', image)
cv2.waitKey(0)
pyshine.audioCapture()
audioCapture(): Send or Get the Audio from pc Microphone
Inputs:
mode: 'send' to send the audio chunk data or 'get' to receive the audio data
Output:
audio: Audio data, which can be accessed using audio.get() or send using audio.put()
usage
import pyshine as ps
mode = 'send'
audio=audioCapture(mode)
pyshine.showPlot()
showPlot(): Plots the live data
Inputs:
audio: audio data obtained
name: 'Tile of the plot'
length defult 8 times 1024
xmin: default 0 along the x axis
ymin: default -0.5 along the x axis
xmax: default 8*1024 along the y axis
ymax: default 0.5 along the y axis
color: Color of the plot (0,1,0.29)
Output:
show the plot()
usage
import pyshine as ps
mode = 'send'
audio,context=ps.audioCapture(mode=mode)
name = 'pyshine.com'
ps.showPlot(context,name=name)
while True:
frame = audio.get()
pyshine.RPSNET
A CNN model for the Keras library, incorporating Rock, Paper, Scissor learnining Network.
import pyshine as ps
from keras.optimizers import Adam
# WIDTH : width of image about 80 pixels
# HEIGHT : height of image about 80 pixels
# DEPTH : dimensions of image such as 3
# NUM_CLASSES : number of classes to classify as output
model =ps.RPSNET.build(width=WIDTH, height=HEIGHT, depth=DEPTH, classes=NUM_CLASSES)
INIT_LR = 1e-3
EPOCHS = 1000
OPT = Adam(lr=INIT_LR, decay=INIT_LR / EPOCHS)
model.compile(
optimizer=OPT,
loss='categorical_crossentropy',
metrics=['accuracy']
)
# data: numpy image array containing data samples
# labels: corresponding labels per data
model.fit(np.array(data), np.array(labels),epochs=EPOCHS)
model.save("RPS-model.h5")
pred = model.predict(np.array([image]))
pyshine.Streamer
Low latency video streamer for webcams and raspberry pi camera.
License
© 2020 PyShine
This repository is licensed under the MIT license. See LICENSE for details.
Metadata
Release files for pyshine 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyshine-0.0.9.tar.gz | 6.8 kB | Without provenance | Details for pyshine-0.0.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyshine-0.0.9-py3-none-any.whl | Python 3 | none | any | Details for pyshine-0.0.9-py3-none-any.whl |
Total release size: 14.2 kB
Release files / pyshine-0.0.9.tar.gz
| Download URL | pyshine-0.0.9.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9989025e7ae50800a86ab1126202ed08765d5caed45e2a09cc72d1ec6670d62a
|
|
BLAKE2b-256 checksum How to use checksums |
6711e917542edaf5d0ff657d661d89c75a2acb6efc78d53014ce57c24be8ec54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.0 setuptools/56.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.4
|
Release files / pyshine-0.0.9-py3-none-any.whl
| Download URL | pyshine-0.0.9-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7405a29fb91e968a43ccb1dcc8fe0d7dea7ab276fef91c8afb728b7fec610ae5
|
|
BLAKE2b-256 checksum How to use checksums |
f9888d48e17f0e01bee3a39f7651f033f6f4474097da5ae20589795fb932272b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.0 setuptools/56.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.4
|
Security for pyshine 0.0.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.