# IdentifyGraph **Repository Path**: BHVHGHJ/IdentifyGraph ## Basic Information - **Project Name**: IdentifyGraph - **Description**: No description available - **Primary Language**: Android - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-07-08 - **Last Updated**: 2021-07-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 基于Android平台的TensorFlew图像识别相机 [TOC] [TensorFlew:](https://blog.csdn.net/masa_fish/article/details/54097796/)深度学习模型支持三个领域的模型训练 1. TF Classify: 实时物体分类 2. TF Detect: 实时行人检测 3. TF Stylize: 实时图片风格迁移 本产品实现的是**TF Classify**到Android平台:iphone:移植。 ### 需求分析 * TensorFlew 模型集成 * JNI Java平台与C++协调 * Camera :camera: 相关功能集成 ### 可行性分析--略:smile: ### 概要设计 ​ 采用TensorFlew已经训练好的分类器:muscle:,获取当前相机:camera:拍摄到的图片:framed_picture:,进行分类识别,最后将结果集返回到UI界面显示,其中结果反应的是当前图片中最有可能是某三种(以内)物体的概论。 **流程图** ```flow start=>start: Start buttonOnclick=>inputoutput: Capture Picture Button Onclicklistener trigger camera capture=>subroutine: Camera capture Picture tensorFlew analysis=>subroutine: TensorFlew analysis picture imageView=>inputoutput: show the captured picture from Camera Kit textView=>inputoutput: show the resultSet from tensorFlew end=>end: End start->buttonOnclick->camera capture->tensorFlew analysis->imageView->textView->end ``` **时序图** ```sequence participant UI participant Model participant Camera Kit participant TensorFlew UI->Camera Kit:Capture() Model->TensorFlew: feed(File model,File label) Camera Kit->TensorFlew: feed(Bitmao picture) Camera Kit -->UI:show(Bitemap picture) TensorFlew-->UI:handMessage(String[] result) ``` TensorFlew feed ```java /** * recognize image * @param bitmap The asset of picture to recognize */ public List recognizeImage(final Bitmap bitmap) { } ``` ```java /** * Initializes a native TensorFlow session for classifying images. * * @param assetManager The asset manager to be used to load assets. * @param modelFilename The filepath of the model GraphDef protocol buffer. * @param labelFilename The filepath of label file for classes. * @param inputSize The input size. A square image of inputSize x inputSize is assumed. * @param imageMean The assumed mean of the image values. * @param imageStd The assumed std of the image values. * @param inputName The label of the image input node. * @param outputName The label of the output node. * @throws IOException */ public static Classifier create( AssetManager assetManager, String modelFilename, String labelFilename, int inputSize, int imageMean, float imageStd, String inputName, String outputName){ } ``` **调用CameraKit库方法** ```java @Override public void start(){ } @Override public void stop(){ } @Override public void captureImage(new CameraKitEventCallback() { } @Override public void callback(CameraKitImage cameraKitImage) { } ``` ### 详细设计 **界面** - 图标 ![72C54EAA76CA60579666589D2CC57910](./72C54EAA76CA60579666589D2CC57910.jpg) - 主界面展示,其中: - camera 区域为相机当前面向的物体 - image 区域为用户想识别的物体照片 - result 区域为照片的识别结果,每一条表示可能的物体以及其概论 - 左下角图标:前后摄像头选择 - 中下角图标:获取对应分类物体的照片按钮,同时展示分类效果 ![主界面](./主界面.png) ![DE547807C0008910B7FCC72BF1772497](./DE547807C0008910B7FCC72BF1772497.jpg) ### 产品使用说明 正常相机怎么用就怎么用:sweat_smile: