Skip to content

Latest commit

 

History

History
87 lines (56 loc) · 2.11 KB

File metadata and controls

87 lines (56 loc) · 2.11 KB

food_classification

Module Name food_classification
Category image classification
Network ResNet50_vd_ssld
Dataset Food Dataset
Fine-tuning supported or not No
Module Size 91MB
Latest update date -
Data indicators -

I.Basic Information

  • Module Introduction

    • This module can be used for food classification.

II.Installation

III.Module API Prediction

  • 1、Command line Prediction

    • $ hub run food_classification --input_path /PATH/TO/IMAGE
    • If you want to call the Hub module through the command line, please refer to: PaddleHub Command Line Instruction
  • 2、Prediction Code Example

    • import paddlehub as hub
      import cv2
      
      classifier = hub.Module(name="food_classification")
      images = [cv2.imread('/PATH/TO/IMAGE')]
      results = classifier.predict(images=images)
      for result in results:
          print(result)
  • 3、API

    • def predict(images)
      • classification API.

      • Parameters

        • images (list[numpy.ndarray]): image data, ndarray.shape is in the format [H, W, C], BGR;
      • Return

        • result(list[dict]): classication results, each element in the list is dict, key is the label name, and value is the corresponding probability
          • category_id (int): category id;
          • category(str): category name;
          • score(float): probability

IV.Release Note

  • 1.0.0

    First release

    • $ hub install food_classification==1.0.0