Skip to main content

NaMAZU: Pretty Usefull Library

Project description

Libray including many(not yet) utilities

PyPI - Python Version PyPI version pl st numpy sklearn


NaMAZU

Lightning API

PyTorch PL

They are all written in PyTorch following best practice to be used with pytorch lightning. They are all GPU enabled controlled by Lightning API. You will never need to call to("cuda") to use the model on any device even with multi-GPU training!

import pytorch_lightning as pl
from NaMAZU import KNN, GMM

class YourLitModule(pl.LightningModule):
    def __init__(self,*args, **kwargs):
        ...
        self.encoder = SomeEncoder()
        self.head_classifier = KNN(
            n_neighbors=5, 
            distance_measure="cosine", 
            training_data=some_known_data
        )
        self.estimator = GMM(5, 10)

    def training_step(self, batch):
        x, t = batch
        y = self.encoder(x)
        y_hat = self.head_classifier(y)
        probability = self.estimator.predict_proba(y)

Statistical Model

  • KNN: Available with euqlidean, manhattan, cosine and mahalanobis distance.
  • NBC: GPU enabled naive bayes classifier.
  • GMM: Gaussian Mixture probabability estimator. Of course GPU enabled.

Deep Learning

They are all ready-to-train models with MNIST, ImageNet, UCF101 etc... using LightingDataModule.

Some models come with their pretrained-weight available by auto-downloading.

  • LitU2Net: LightningModule U2Net. Trainable and ready for prediction.
  • AniNet: LightningModule image classifier pretrained for japanese animations.
  • LitVideoClf: LightningModule video classfier using either single frame CNN or CNNLSTM.
  • PredictionAssistant: Coming soon.

Functional API

NumPy FFmpeg OpenCV SKlearn

You can use below functions via

import NaMAZU.functional as F

F.change_frame_rates_in("./test_data.mp4",fps=5)

image_control

  • npy_to_img
  • img_to_npy
  • split_image
  • compose_two_png
  • apply_mask_to
  • apply_to_all
  • change_frame_rates_in
  • save_all_frames

file_control

  • rename_file
  • collect_file_pathes_by_ext
  • zip_files

data_science

  • train_linear_regressor

:rocket: Coming

  • 1. st_integration. Usuful snipets and fast deoployment of LitModule to streamlit. (clf_template)
  • 2. InferenceHelper
  • 2. Video Recognition Model
  • 3. Feature Learning
  • 4. Few-shot Learning
  • 5. Audio-Visual Multimodal fusion
  • 6. BBox template finding
  • 7. CACNet

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

NaMAZU-0.0.37-py3-none-any.whl (80.7 kB view hashes)

Uploaded Python 3

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