# TensorFlow-Slim image classification model library
[TF-slim](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/slim)
is a new lightweight high-level API of TensorFlow (`tensorflow.contrib.slim`)
for defining, training and evaluating complex
models. This directory contains
code for training and evaluating several widely used Convolutional Neural
Network (CNN) image classification models using TF-slim.
It contains scripts that will allow
you to train models from scratch or fine-tune them from pre-trained network
weights. It also contains code for downloading standard image datasets,
converting them
to TensorFlow's native TFRecord format and reading them in using TF-Slim's
data reading and queueing utilities. You can easily train any model on any of
these datasets, as we demonstrate below. We've also included a
[jupyter notebook](https://github.com/tensorflow/models/blob/master/research/slim/slim_walkthrough.ipynb),
which provides working examples of how to use TF-Slim for image classification.
For developing or modifying your own models, see also the [main TF-Slim page](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/slim).
## Contacts
Maintainers of TF-slim:
* Nathan Silberman,
github: [nathansilberman](https://github.com/nathansilberman)
* Sergio Guadarrama, github: [sguada](https://github.com/sguada)
## Citation
"TensorFlow-Slim image classification model library"
N. Silberman and S. Guadarrama, 2016.
https://github.com/tensorflow/models/tree/master/research/slim
## Table of contents
<a href="#Install">Installation and setup</a><br>
<a href='#Data'>Preparing the datasets</a><br>
<a href='#Pretrained'>Using pre-trained models</a><br>
<a href='#Training'>Training from scratch</a><br>
<a href='#Tuning'>Fine tuning to a new task</a><br>
<a href='#Eval'>Evaluating performance</a><br>
<a href='#Export'>Exporting Inference Graph</a><br>
<a href='#Troubleshooting'>Troubleshooting</a><br>
# Installation
<a id='Install'></a>
In this section, we describe the steps required to install the appropriate
prerequisite packages.
## Installing latest version of TF-slim
TF-Slim is available as `tf.contrib.slim` via TensorFlow 1.0. To test that your
installation is working, execute the following command; it should run without
raising any errors.
```
python -c "import tensorflow.contrib.slim as slim; eval = slim.evaluation.evaluate_once"
```
## Installing the TF-slim image models library
To use TF-Slim for image classification, you also have to install
the [TF-Slim image models library](https://github.com/tensorflow/models/tree/master/research/slim),
which is not part of the core TF library.
To do this, check out the
[tensorflow/models](https://github.com/tensorflow/models/) repository as follows:
```bash
cd $HOME/workspace
git clone https://github.com/tensorflow/models/
```
This will put the TF-Slim image models library in `$HOME/workspace/models/research/slim`.
(It will also create a directory called
[models/inception](https://github.com/tensorflow/models/tree/master/research/inception),
which contains an older version of slim; you can safely ignore this.)
To verify that this has worked, execute the following commands; it should run
without raising any errors.
```
cd $HOME/workspace/models/research/slim
python -c "from nets import cifarnet; mynet = cifarnet.cifarnet"
```
# Preparing the datasets
<a id='Data'></a>
As part of this library, we've included scripts to download several popular
image datasets (listed below) and convert them to slim format.
Dataset | Training Set Size | Testing Set Size | Number of Classes | Comments
:------:|:---------------:|:---------------------:|:-----------:|:-----------:
Flowers|2500 | 2500 | 5 | Various sizes (source: Flickr)
[Cifar10](https://www.cs.toronto.edu/~kriz/cifar.html) | 60k| 10k | 10 |32x32 color
[MNIST](http://yann.lecun.com/exdb/mnist/)| 60k | 10k | 10 | 28x28 gray
[ImageNet](http://www.image-net.org/challenges/LSVRC/2012/)|1.2M| 50k | 1000 | Various sizes
VisualWakeWords|82783 | 40504 | 2 | Various sizes (source: MS COCO)
## Downloading and converting to TFRecord format
For each dataset, we'll need to download the raw data and convert it to
TensorFlow's native
[TFRecord](https://www.tensorflow.org/versions/r0.10/api_docs/python/python_io.html#tfrecords-format-details)
format. Each TFRecord contains a
[TF-Example](https://github.com/tensorflow/tensorflow/blob/r0.10/tensorflow/core/example/example.proto)
protocol buffer. Below we demonstrate how to do this for the Flowers dataset.
```shell
$ DATA_DIR=/tmp/data/flowers
$ python download_and_convert_data.py \
--dataset_name=flowers \
--dataset_dir="${DATA_DIR}"
```
When the script finishes you will find several TFRecord files created:
```shell
$ ls ${DATA_DIR}
flowers_train-00000-of-00005.tfrecord
...
flowers_train-00004-of-00005.tfrecord
flowers_validation-00000-of-00005.tfrecord
...
flowers_validation-00004-of-00005.tfrecord
labels.txt
```
These represent the training and validation data, sharded over 5 files each.
You will also find the `$DATA_DIR/labels.txt` file which contains the mapping
from integer labels to class names.
You can use the same script to create the mnist and cifar10 datasets.
However, for ImageNet, you have to follow the instructions
[here](https://github.com/tensorflow/models/blob/master/research/inception/README.md#getting-started).
Note that you first have to sign up for an account at image-net.org.
Also, the download can take several hours, and could use up to 500GB.
For the visualwakewords dataset, you need to download the MSCOCO dataset [here](https://github.com/tensorflow/models/blob/master/research/slim/datasets/download_mscoco.sh)
and build TFRecords with the following instructions
[here](https://github.com/tensorflow/models/blob/master/research/slim/datasets/build_visualwakewords_data.py).
## Creating a TF-Slim Dataset Descriptor.
Once the TFRecord files have been created, you can easily define a Slim
[Dataset](https://github.com/tensorflow/tensorflow/blob/r0.10/tensorflow/contrib/slim/python/slim/data/dataset.py),
which stores pointers to the data file, as well as various other pieces of
metadata, such as the class labels, the train/test split, and how to parse the
TFExample protos. We have included the TF-Slim Dataset descriptors
for
[Cifar10](https://github.com/tensorflow/models/blob/master/research/slim/datasets/cifar10.py),
[ImageNet](https://github.com/tensorflow/models/blob/master/research/slim/datasets/imagenet.py),
[Flowers](https://github.com/tensorflow/models/blob/master/research/slim/datasets/flowers.py),
[VisualWakeWords](https://github.com/tensorflow/models/blob/master/research/slim/datasets/visualwakewords.py),
and
[MNIST](https://github.com/tensorflow/models/blob/master/research/slim/datasets/mnist.py).
An example of how to load data using a TF-Slim dataset descriptor using a
TF-Slim
[DatasetDataProvider](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/slim/python/slim/data/dataset_data_provider.py)
is found below:
```python
import tensorflow as tf
from datasets import flowers
slim = tf.contrib.slim
# Selects the 'validation' dataset.
dataset = flowers.get_split('validation', DATA_DIR)
# Creates a TF-Slim DataProvider which reads the dataset in the background
# during both training and testing.
provider = slim.dataset_data_provider.DatasetDataProvider(dataset)
[image, label] = provider.get(['image', 'label'])
```
## An automated script for processing ImageNet data.
Training a model with the ImageNet dataset is a common request. To facilitate
working with the ImageNet dataset, we provide an automated script for
downloading and processing the ImageNet dataset into the native TFRecord
format.
The TFRecord format consists of a set of sharded files where each entry is a serialized `tf.Example` proto. Each `tf.Example` proto contains the ImageNet image (JPEG encoded) as well as metadata such as label and bounding b
没有合适的资源?快使用搜索试试~ 我知道了~
Pyhon基于YOLOV实现的车辆品牌及型号检测项目源码+模型+项目文档
共1510个文件
py:680个
pyc:432个
proto:54个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 3 下载量 121 浏览量
2023-12-11
09:55:00
上传
评论 1
收藏 586.42MB ZIP 举报
温馨提示
Pyhon基于YOLOV实现的车辆品牌及型号检测项目源码+模型+项目文档 最终的项目文档在 《车辆检测项目汇报.docx》 程序展示请看 《录屏.mp4》 整合代码请看 [car_recognition] 项目工程, 其中,Yolo和InceptionV4 训练的模型参数在下面的目录里: yolo.h5 放在car_recognition\model_data, freezed.pb 放在car_recognition\inceptionV4\outputfile那里
资源推荐
资源详情
资源评论
收起资源包目录
Pyhon基于YOLOV实现的车辆品牌及型号检测项目源码+模型+项目文档 (1510个子文件)
BUILD 17KB
BUILD 17KB
BUILD 12KB
BUILD 12KB
BUILD 10KB
BUILD 10KB
BUILD 7KB
BUILD 7KB
BUILD 7KB
BUILD 7KB
BUILD 7KB
BUILD 7KB
BUILD 6KB
BUILD 6KB
BUILD 4KB
BUILD 4KB
BUILD 4KB
BUILD 4KB
BUILD 2KB
BUILD 2KB
BUILD 2KB
BUILD 2KB
BUILD 1KB
BUILD 1KB
BUILD 1KB
BUILD 1KB
BUILD 942B
BUILD 942B
BUILD 884B
BUILD 884B
BUILD 718B
BUILD 718B
yolov3.cfg 8KB
yolov3.cfg 8KB
darknet53.cfg 6KB
darknet53.cfg 6KB
yolov3-tiny.cfg 2KB
yolov3-tiny.cfg 2KB
ssd_mobilenet_v1_coco.config 5KB
ssd_mobilenet_v1_coco.config 5KB
ssd_mobilenet_v1_pets.config 5KB
ssd_mobilenet_v1_pets.config 5KB
ssd_mobilenet_v1_pets.config 5KB
ssd_inception_v2_coco.config 5KB
ssd_inception_v2_coco.config 5KB
ssd_inception_v2_pets.config 5KB
ssd_inception_v2_pets.config 5KB
faster_rcnn_nas_coco.config 4KB
faster_rcnn_nas_coco.config 4KB
faster_rcnn_inception_resnet_v2_atrous_oid.config 4KB
faster_rcnn_inception_resnet_v2_atrous_oid.config 4KB
faster_rcnn_inception_resnet_v2_atrous_coco.config 4KB
faster_rcnn_inception_resnet_v2_atrous_coco.config 4KB
faster_rcnn_inception_resnet_v2_atrous_pets.config 4KB
faster_rcnn_inception_resnet_v2_atrous_pets.config 4KB
faster_rcnn_resnet152_coco.config 4KB
faster_rcnn_resnet152_coco.config 4KB
faster_rcnn_resnet101_coco.config 4KB
faster_rcnn_resnet101_coco.config 4KB
faster_rcnn_resnet50_coco.config 4KB
faster_rcnn_resnet50_coco.config 4KB
faster_rcnn_inception_v2_coco.config 4KB
faster_rcnn_inception_v2_coco.config 4KB
faster_rcnn_resnet101_pets.config 4KB
faster_rcnn_resnet101_pets.config 4KB
faster_rcnn_inception_v2_pets.config 4KB
faster_rcnn_inception_v2_pets.config 4KB
faster_rcnn_resnet152_pets.config 4KB
faster_rcnn_resnet152_pets.config 4KB
faster_rcnn_resnet50_pets.config 4KB
faster_rcnn_resnet50_pets.config 4KB
rfcn_resnet101_coco.config 4KB
rfcn_resnet101_coco.config 4KB
rfcn_resnet101_pets.config 4KB
rfcn_resnet101_pets.config 4KB
faster_rcnn_resnet101_kitti.config 4KB
faster_rcnn_resnet101_kitti.config 4KB
faster_rcnn_resnet101_voc07.config 3KB
faster_rcnn_resnet101_voc07.config 3KB
第三周汇报.doc 4.93MB
第二周汇报.doc 1.96MB
车辆检测项目汇报.docx 5.15MB
第一周项目汇报.docx 846KB
yolo.h5 237.17MB
car_recognition.iml 455B
research.iml 453B
inceptionV4.iml 444B
research.iml 442B
car_recognition.iml 398B
slim_walkthrough.ipynb 1.69MB
slim_walkthrough.ipynb 1.69MB
mobilenet_example.ipynb 168KB
slim_walkthrough-checkpoint.ipynb 46KB
slim_walkthrough.ipynb 45KB
slim_walkthrough.ipynb 45KB
object_detection_tutorial.ipynb 9KB
object_detection_tutorial.ipynb 9KB
image2.jpg 1.35MB
image2.jpg 1.35MB
5a8ec55e-9e24-11e9-90de-32b49eeb6b78.jpg 945KB
共 1510 条
- 1
- 2
- 3
- 4
- 5
- 6
- 16
资源评论
- 上山-下山2024-02-14怎么能有这么好的资源!只能用感激涕零来形容TAT...
- m0_662909612024-03-07资源很不错,内容和描述一致,值得借鉴,赶紧学起来!
- lwq85522024-05-15感谢资源主的分享,很值得参考学习,资源价值较高,支持!
程序员柳
- 粉丝: 6562
- 资源: 1443
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功