Skip to content

JiuJiuChe/drill-bits

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Drill-Bits: Handy tools for ML in Python

https://img.shields.io/travis/com/jiujiuche/drill-bits https://img.shields.io/github/languages/top/jiujiuche/drill-bits https://img.shields.io/codecov/c/github/jiujiuche/drill-bits https://img.shields.io/github/license/jiujiuche/drill-bits https://img.shields.io/github/last-commit/jiujiuche/drill-bits

Install

pip install drill-bits

Examples

All type read & write:

from drill-bits.io import io_utils
data = io_utils.omni_load(file_name)
io_utils.omni_save(file_name, data)

Currently supported extensions including: .npy, .txt, .pkl, .jpg, .png.

Extract digit information from str:

    from drill_bits.io import str_utils

test_str = 'img1_h102_w103.img'
resolution = str_utils.extract_info(test_str, ['h', 'w'], int)
# resolution will be [102, 103]

A decorator saves you from reprocessing:

import time
    from drill_bits.operation import base_operation

def foo(n):
    time.sleep(1)
    if n == 1:
            return 1
    else:
            return n * foo(n-1)

opt = BaseOperation(path).get_handle(force_run=False, verbose=True)
foo_warp = opt(foo)
print(foo_warp(5))      # it will take 5s to run
print(foo_warp(5))      # it will finish immediately
opt = BaseOperation(path).get_handle(force_run=True, verbose=True)
foo_warp = opt(foo)
print(foo_warp(5))      # it will take 5s to run again

About

Handy tools for ML in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages