Skip to content

Commit

Permalink
Merge pull request ARM-software#2 from ARM-software/yolo_v3_tiny
Browse files Browse the repository at this point in the history
Added YOLO v3 Tiny
  • Loading branch information
tom-arm authored Dec 3, 2020
2 parents ff25f80 + 3f30241 commit 8416ebb
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.DS_STORE
.DS_STORE
.vscode
1 change: 1 addition & 0 deletions MODEL_LIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@
|-----------------|---------|--------------|
| [SSD MobileNet v1 FP32](models/object_detection/ssd_mobilenet_v1/tflite_fp32) | FP32 | TensorFlow Lite |
| [SSD MobileNet v1 UINT8](models/object_detection/ssd_mobilenet_v1/tflite_uint8) | UINT8 | TensorFlow Lite |
| [YOLO v3 Tiny FP32](models/object_detection/yolo_v3_tiny/tflite_fp32) | FP32 | TensorFlow Lite |
33 changes: 33 additions & 0 deletions models/object_detection/yolo_v3_tiny/tflite_fp32/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# YOLO v3 Tiny FP32

## Description
Yolo v3 Tiny is a object detection network, that localizes and identifies objects in an input image. This is a floating point version that takes a 416x416 input image and outputs detections for this image. This model is generated using the weights from the [https://pjreddie.com/darknet/yolo/](YOLO website).

## License
[Apache-2.0](https://spdx.org/licenses/Apache-2.0.html)

## Network Information
| Network Information | Value |
|---------------------|------------------|
| Framework | TensorFlow Lite |
| SHA-1 Hash | b38f7be6856eed4466493bdc86be1879f4b743fb |
| Size (Bytes) | 35455980 |
| Provenance | https://pjreddie.com/media/files/yolov3-tiny.weights & https://github.com/mystic123/tensorflow-yolo-v3 |
| Paper | https://arxiv.org/abs/1804.02767 |

## Accuracy
Dataset: MS COCO Validation

| Metric | Value |
|--------|-------|
| mAP | 0.331 |

## Network Inputs
| Input Node Name | Shape | Description |
|-----------------|---------|-------------|
| inputs | (1, 416, 416, 3) | A 416x416 floating point input image. |

## Network Outputs
| Output Node Name | Shape | Description |
|------------------|---------|-------------|
| output_boxes | (1, 2535, 85) | A 1xNx85 map of predictions, where the first 4 entries of the 3rd dimension are the bounding box coordinates and the 5th is the confidence. The remaining entries are softmax scores for each class. |
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# YOLO v3 Tiny FP32 Model Re-Creation
This folder contains a script that allows for the model to be re-created from scratch.

## Requirements
The script in this folder requires that the following must be installed:
- Python 3.6

## Running The Script
To run the script, run the following in a terminal: `./recreate_model.sh`
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright (C) 2020 Arm Limited or its affiliates. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
# 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
#
# 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.

#!/usr/bin/env bash

python3.6 -m venv venv
source venv/bin/activate

pip install -r requirements.txt

git clone https://github.com/mystic123/tensorflow-yolo-v3
pushd tensorflow-yolo-v3

wget https://raw.githubusercontent.com/pjreddie/darknet/master/data/coco.names
wget https://pjreddie.com/media/files/yolov3-tiny.weights

python convert_weights_pb.py --class_names coco.names --weights_file yolov3-tiny.weights --data_format NHWC --tiny

pip install tensorflow==1.15.0

tflite_convert --graph_def_file=frozen_darknet_yolov3_model.pb --output_file=yolo_v3_tiny_darknet_fp32.tflite --input_shapes=1,416,416,3 --input_arrays=inputs --output_arrays=output_boxes
mv yolo_v3_tiny_darknet_fp32.tflite ..

popd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
absl-py==0.11.0
astor==0.8.1
cached-property==1.5.2
gast==0.4.0
grpcio==1.33.2
h5py==3.1.0
importlib-metadata==2.0.0
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.2
Markdown==3.3.3
numpy==1.19.4
Pillow==8.0.1
protobuf==3.14.0
six==1.15.0
tensorboard==1.11.0
tensorflow==1.11.0
termcolor==1.1.0
Werkzeug==1.0.1
zipp==3.4.0
Git LFS file not shown

0 comments on commit 8416ebb

Please sign in to comment.