Skip to main content

OM Simple

Project description

Image Classification

pip install om-simple

Data Preparation

{dataset name}/
├── train/
│   ├── {class1}/
│   ├── {class2}/
│   ├── ...
└── val/
    ├── {class1}/
    ├── {class2}/
    ├── ...

Example Code

from om_simple.img_class_head import ImageClassification
from om_simple.img_class_model import run_train
from om_simple.tools.utils import is_blur

# Train
run_train("{dataset name}",
    model_name="{model_name}", # e.g., resnet18, resnet50, vit_base_patch16_224, etc....
    outdir="{output_dir}")

# Simple Classification
X = ImageClassification("epoch099.ckpt")
z = X.predict(images=["sample.jpg"])


# Blur detection
print (is_blur("sample.jpg"))

# Multi label classification

from om_simple.multi_class_model import MultiClass
X = MultiClass("model.ckpt","label.json")
z = X.predict(images=["sample.jpg"])

How to get available model_name

import timm
avail_pretrained_models = timm.list_models(pretrained=True)
print (avail_pretrained_models)

all_vit_models = timm.list_models('vit*')
print (all_vit_models)

Tensorboard

tensorboard --logdir {output_dir} --bind_all

Project details


Download files

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

Source Distribution

om_simple-0.1.6.tar.gz (1.4 MB view details)

Uploaded Source

File details

Details for the file om_simple-0.1.6.tar.gz.

File metadata

  • Download URL: om_simple-0.1.6.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.26.0 setuptools/58.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.6

File hashes

Hashes for om_simple-0.1.6.tar.gz
Algorithm Hash digest
SHA256 89e1513a471c1879e20a1c8128645bd8d8510b9cde6eef82d4eec87d4664e170
MD5 28829d855467595aee18e791e09ee249
BLAKE2b-256 d794065fb7be29b208b55435ee94a7cf6468277c730549a7882aede4bf74dc9c

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