We are very excited to join forces with OctoML.ai! Contact Grigori Fursin for more details!
program:image-classification-tflite-codereef (v1.0.2)
Creation date: 2019-10-07
Source: GitHub
cID: b0ac08fe1d3c2615:46fa1f0bd6d1bdf6

Don't hesitate to get in touch if you encounter any issues or would like to discuss this community project!
Please report if this CK component works: 1  or fails: 0 
Sign up to be notified when artifacts are shared or updated!

Description  

This portable workflow is our attempt to provide a common CLI with Python JSON API and a JSON meta description to automatically detect or install required components (models, data sets, libraries, frameworks, tools), and then build, run, validate, benchmark and auto-tune the associated method (program) across diverse models, datasets, compilers, platforms and environments. Our on-going project is to make the onboarding process as simple as possible via this platform. Please check this CK white paper and don't hesitate to contact us if you have suggestions or feedback!
  • Automation framework: CK
  • Development repository: ck-tensorflow-codereef
  • Source: GitHub
  • Available command lines:
    • ck run program:image-classification-tflite-codereef --cmd_key=default (META)
  • Support for host OS: any
  • Support for target OS: android, linux
  • Tags: image-classification,tflite,lang-cpp,codereef-workflow,codereef-workflow-webcam
  • Template: Image Classification via TFLite (C++)
  • How to get the stable version via the client:
    pip install cbench
    cb download program:image-classification-tflite-codereef --version=1.0.2 --all
    ck run program:image-classification-tflite-codereef
  • How to get the development version:
    pip install ck
    ck pull repo --url=https://github.com/code-reef/ck-tensorflow-codereef
    ck run program:image-classification-tflite-codereef

  • CLI and Python API: module:program
  • Dependencies    

    ReadMe  

    TensorFlow Lite image classification program

    This program uses a statically linked TensorFlow Lite library.

    Prerequisites

    SciPy

    # apt install liblapack-dev libatlas-dev
    # python -m pip install scipy
    

    TensorFlow library

    $ ck install package:lib-tflite-0.1.7-src-static [--target_os=android23-arm64]
    

    NB: Use --target_os=android23-arm64 to build for Android API 23 (v6.0 "Marshmallow") or similar.

    TensorFlow models

    Install a model providing a graph as tflite file e.g.:

    $ ck install package:tensorflowmodel-mobilenet-v1-1.0-224-2018_02_22-py
    $ ck install package:tensorflowmodel-mobilenet-v2-1.0-224-py
    

    ImageNet dataset

    $ ck install package --tags=small_dataset,imagenet,raw,val
    $ ck install package:imagenet-2012-aux 
    

    Build

    $ ck compile program:image-classification-tflite [--target_os=android23-arm64]
    

    Run

    $ ck run program:image-classification-tflite [--target_os=android23-arm64]
    

    Program parameters

    Input image parameters

    CK_IMAGE_FILE

    If set, the program will classify a single image instead of iterating over a dataset. When only the name of an image is specified, it is assumed that the image is in the ImageNet dataset.

    $ ck run program:image-classification-tflite --env.CK_IMAGE_FILE=/tmp/images/path-to-image.jpg
    $ ck run program:image-classification-tflite --env.CK_IMAGE_FILE=ILSVRC2012_val_00000011.JPEG
    

    CK_RECREATE_CACHE

    If set to YES, then all previously cached images will be erased.

    Default: NO.

    Input preprocessing parameters

    CK_TMP_IMAGE_SIZE

    The size of an intermediate image. If this preprocessing parameter is set to a value greater than the input image size defined by the model, input images will be first scaled to this size and then cropped to the input size.

    For example, if --env.CK_TMP_IMAGE_SIZE=256 is specified for MobileNets models with the input image resolution of 224, then input images will be first resized to 256x256 and then cropped to 224x224.

    Default: 0.

    CK_CROP_PERCENT

    The percentage of the central image region to crop. If this preprocessing parameter is set to a value between 0 and 100, then loaded images will be cropped according this percentage and then scaled to the input image size defined by the model.

    Default: 87.5.

    NB: If CK_TMP_IMAGE_SIZE is set and valid, this parameter is not used.

    CK_SUBTRACT_MEAN

    If set to YES, then the mean value will be subtracted from the input image.

    Default: YES.

    Versions  

    Files  

    Comments  

    Please log in to add your comments!
    If you notice any inapropriate content that should not be here, please report us as soon as possible and we will try to remove it within 48 hours!