快速搭建垃圾分类模型:
使用inception快速搭建的图像分类模型,目前支持1000类识别。从图像中识别出类别后,再通过textcnn模型对垃圾类别进行映射,最终输出垃圾的类别。
注:垃圾类别是以上海分类标准。
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-07-06 10:03 rafuse_recognize
文件 1731 2019-07-06 10:02 rafuse_recognize
afuse.py
文件 1246 2019-07-06 10:03 rafuse_recognize
eadme.md
文件 8636 2019-07-06 09:52 rafuse_recognizeclassify_image.py
目录 0 2019-07-06 08:41 rafuse_recognize
uns
目录 0 2019-07-06 03:06 rafuse_recognizeimg
文件 216613 2019-07-06 01:22 rafuse_recognizeimg2.png
文件 75388 2019-07-06 01:17 rafuse_recognizeimg1.png
目录 0 2019-07-06 08:39 rafuse_recognizedata
文件 346 2019-07-06 08:31 rafuse_recognizedatavalid_data.txt
文件 24223 2019-07-06 06:19 rafuse_recognizedataimagenet_2012_challenge_label_chinese_map.pbtxt
文件 64986 2019-07-06 03:13 rafuse_recognizedataimagenet_2012_challenge_label_map_proto.pbtxt
文件 741401 2019-07-06 03:07 rafuse_recognizedataimagenet_synset_to_human_label_map.txt
文件 1544 2019-07-06 07:02 rafuse_recognizedata rain_data.txt
文件 4131771 2017-08-25 01:45 rafuse_recognizedataword2vec.bin
目录 0 2019-07-06 09:52 rafuse_recognize\__pycache__
文件 6763 2019-07-06 09:52 rafuse_recognize\__pycache__classify_image.cpython-35.pyc
目录 0 2019-07-06 09:17 rafuse_recognize extcnn
文件 4125 2019-07-06 09:01 rafuse_recognize extcnn ext_cnn.py
文件 9948 2019-07-06 08:41 rafuse_recognize extcnn rain.py
文件 2726 2019-07-06 09:15 rafuse_recognize extcnnpredict.py
文件 459 2019-07-06 09:17 rafuse_recognize extcnnREADME.md
文件 3816 2019-07-06 08:39 rafuse_recognize extcnneval.py
文件 4352 2019-07-06 07:35 rafuse_recognize extcnndata_input_helper.py
目录 0 2019-07-06 08:42 rafuse_recognize
unscheckpoints
文件 335 2019-07-06 08:42 rafuse_recognize
unscheckpointscheckpoint
文件 1115 2019-07-06 08:42 rafuse_recognize
unscheckpointsmodel-2000.index
文件 13993020 2019-07-06 08:42 rafuse_recognize
unscheckpointsmodel-2000.data-00000-of-00001
文件 4189170 2019-07-06 08:42 rafuse_recognize
unscheckpointsmodel-2000.meta
目录 0 2019-07-06 09:42 rafuse_recognize extcnn\__pycache__
文件 2781 2019-07-06 09:42 rafuse_recognize extcnn\__pycache__predict.cpython-35.pyc
............此处省略2个文件信息
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License Version 2.0 (the “License“);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing software
# distributed under the License is distributed on an “AS IS“ BASIS
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
“““Simple image classification with Inception.
Run image classification with Inception trained on ImageNet 2012 Challenge data
set.
This program creates a graph from a saved GraphDef protocol buffer
and runs inference on an input JPEG image. It outputs human readable
strings of the top 5 predictions along with their probabilities.
Change the --image_file argument to any jpg image to compute a
classification of that image.
Please see the tutorial and website for a detailed description of how
to use this script to perform image recognition.
https://tensorflow.org/tutorials/image_recognition/
“““
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os.path
import re
import sys
import tarfile
import numpy as np
from six.moves import urllib
import tensorflow as tf
FLAGS = None
# pylint: disable=line-too-long
DATA_URL = ‘http://download.tensorflow.org/models/image/imagenet/inception-2015-12-05.tgz‘
# pylint: enable=line-too-long
class NodeLookup(object):
“““Converts integer node ID‘s to human readable labels.“““
def __init__(self
uid_chinese_lookup_path
model_dir
label_lookup_path=None
uid_lookup_path=None):
if not label_lookup_path:
label_lookup_path = os.path.join(
model_dir ‘imagenet_2012_challenge_label_map_proto.pbtxt‘)
if not uid_lookup_path:
uid_lookup_path = os.path.join(
model_dir ‘imagenet_synset_to_human_label_map.txt‘)
#self.node_lookup = self.load(label_lookup_path uid_lookup_path)
self.node_lookup = self.load_chinese_map(uid_chinese_lookup_path)
def load(self label_lookup_path uid_lookup_path):
“““Loads a human readable English name for each softmax node.
Args:
label_lookup_path: string UID to integer node ID.
uid_lookup_path: string UID to human-readable string.
Returns:
dict from integer node ID to human-readable string.
“““
if not tf.gfile.Exists(uid_lookup_path):
tf.logging.fatal(‘File does not exist %s‘ uid_lookup_path)
if not tf.gfile.Exists(label_lookup_path):
tf.logging.fatal(‘File does not exist %s‘ label_lookup_path)
# Loads mapping from string UID to human-readable string
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-07-06 10:03 rafuse_recognize
文件 1731 2019-07-06 10:02 rafuse_recognize
afuse.py
文件 1246 2019-07-06 10:03 rafuse_recognize
eadme.md
文件 8636 2019-07-06 09:52 rafuse_recognizeclassify_image.py
目录 0 2019-07-06 08:41 rafuse_recognize
uns
目录 0 2019-07-06 03:06 rafuse_recognizeimg
文件 216613 2019-07-06 01:22 rafuse_recognizeimg2.png
文件 75388 2019-07-06 01:17 rafuse_recognizeimg1.png
目录 0 2019-07-06 08:39 rafuse_recognizedata
文件 346 2019-07-06 08:31 rafuse_recognizedatavalid_data.txt
文件 24223 2019-07-06 06:19 rafuse_recognizedataimagenet_2012_challenge_label_chinese_map.pbtxt
文件 64986 2019-07-06 03:13 rafuse_recognizedataimagenet_2012_challenge_label_map_proto.pbtxt
文件 741401 2019-07-06 03:07 rafuse_recognizedataimagenet_synset_to_human_label_map.txt
文件 1544 2019-07-06 07:02 rafuse_recognizedata rain_data.txt
文件 4131771 2017-08-25 01:45 rafuse_recognizedataword2vec.bin
目录 0 2019-07-06 09:52 rafuse_recognize\__pycache__
文件 6763 2019-07-06 09:52 rafuse_recognize\__pycache__classify_image.cpython-35.pyc
目录 0 2019-07-06 09:17 rafuse_recognize extcnn
文件 4125 2019-07-06 09:01 rafuse_recognize extcnn ext_cnn.py
文件 9948 2019-07-06 08:41 rafuse_recognize extcnn rain.py
文件 2726 2019-07-06 09:15 rafuse_recognize extcnnpredict.py
文件 459 2019-07-06 09:17 rafuse_recognize extcnnREADME.md
文件 3816 2019-07-06 08:39 rafuse_recognize extcnneval.py
文件 4352 2019-07-06 07:35 rafuse_recognize extcnndata_input_helper.py
目录 0 2019-07-06 08:42 rafuse_recognize
unscheckpoints
文件 335 2019-07-06 08:42 rafuse_recognize
unscheckpointscheckpoint
文件 1115 2019-07-06 08:42 rafuse_recognize
unscheckpointsmodel-2000.index
文件 13993020 2019-07-06 08:42 rafuse_recognize
unscheckpointsmodel-2000.data-00000-of-00001
文件 4189170 2019-07-06 08:42 rafuse_recognize
unscheckpointsmodel-2000.me
目录 0 2019-07-06 09:42 rafuse_recognize extcnn\__pycache__
文件 2781 2019-07-06 09:42 rafuse_recognize extcnn\__pycache__predict.cpython-35.pyc
............此处省略2个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)