Some tools function
Project description
guang
Scientific calculation of universal function library
Requirements
Python 3
CUDA >= 10.0
PyTorch >= 1.0
Tensorflow >= 1.12.0
opencv-python
pydub
librosa==0.6.3
pyworld
soundfile
pypinyin
hmmlearn
Installation
pip install guang
Install Explorer Edition
pip install git+https://github.com/beidongjiedeguang/guang.git
Examples
-
Convert audio in .mp3/ .wav format to (sample rate=16k, single channel) .wav format
from guang.Voice.convert improt cvt2wav cvt2wav(orig_path, target_path, sr=16000)
-
Use
dict_dotable
to convert a dictionary to dot-able dictionary:from guang.Utils.toolsFunc import dict_dotable a = {'a':{'b':1}} a = dict_dotable(a) print(a.a.b) >> 1
-
Use
probar
to display current progressfrom guang.Utils.toolsFunc import probar for i in probar(range(10)): time.sleep(0.8) >> 100.00% 0'7.3"|0'7.3" Expect:12-2 23:59:8
-
@broadcast
broadcast a non-broadcast function.from guang.Utils.toolsFunc import broadcast @broadcast def f(x): # A function that can map only a single element if x==1 or x==0: return x else: return f(x-1)+f(x-2) >> f([2,4,10]) >> array([1, 3, 832040], dtype=object)
-
txt2ph
Convert Chinese characters to phonemefrom guang.Voice.txt2pinyin import txt2ph txt2ph('你好,我是光') >> [('n', 'i3'), ('h', 'ao3'), ('sp1',), ('uo3',), ('sh', 'ii4'), ('g', 'uang1')]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
guang-0.0.7.5.2.tar.gz
(19.3 kB
view hashes)
Built Distribution
guang-0.0.7.5.2-py3-none-any.whl
(37.4 kB
view hashes)
Close
Hashes for guang-0.0.7.5.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42c23858cfa0aeb8b16eab1da3f9c7d55e8d5dd9567152f9a1ed95c9dfa356df |
|
MD5 | fa9b0924785e56b378ed0f9a67c6dd56 |
|
BLAKE2b-256 | a790cddf0c4f90d38d52ec25f7dfbc6b3eaf7915cbffbb8acde23bb3094cdb13 |