Skip to main content

OM Simple Encoder

Project description

Om Simple Encoder

Om Simple Encoder is to fintune the query encoder. Currently it includes only query image encoder.

Install

pip install om_simple_encoder

How to start training

python train.py --img_dir {image_root_path} --data {data json} --num_workers=15 --gpus=1 --batch_size=64 

Data Format

[ {"key1": ["image1.jpg","image2.jpg"], "key2":  ["image1.jpg","image2.jpg"]},...]

Demo prediction

from om_simple_encoder.encoder import Encoder
h_enc = Encoder("brand_model_v1.ckpt")
encoded_embeddings = h_enc.images(["a.png"])
print (encoded_embeddings)

Demo Train

from om_simple_encoder import train 

if __name__ == '__main__':
    train.start_train(model_type="resnet50", img_dir="/mnt/soco1/brands", data="brands.json", batch_size=64)

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_encoder-0.1.3.tar.gz (1.4 MB view hashes)

Uploaded Source

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