Skip to content

Commit

Permalink
Merge pull request #135 from lacmus-foundation/tf-2.4.2
Browse files Browse the repository at this point in the history
remove keras, update to tf 2.4
  • Loading branch information
gosha20777 authored Aug 18, 2021
2 parents e45ae0d + 69b1bf6 commit 730428a
Show file tree
Hide file tree
Showing 43 changed files with 121 additions and 1,762 deletions.
95 changes: 46 additions & 49 deletions ResNet50RetinaNet-Image.ipynb

Large diffs are not rendered by default.

59 changes: 28 additions & 31 deletions ResNet50RetinaNet-Video.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Prerequisites"
]
],
"metadata": {}
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This notebook requires numpy, tensorflow, keras, OpenCV and matplotlib libraries being installed on your machine. <br>\n",
"If executing without creating snapshot files beforehand, as described in <a href=\"https://github.com/lizaalert/lacmus/blob/master/docs/train-usage.md\">train-usage.md</a>, compile Cython extentions first by running from the console:\n",
Expand All @@ -22,20 +21,19 @@
"(Pay attention to the file size!) <br><br>\n",
"Examples can be found here:<br>\n",
"<a href=\"https://github.com/lizaalert/lacmus/blob/master/docs/work-demo.md\">https://github.com/lizaalert/lacmus/blob/master/docs/work-demo.md</a>"
]
],
"metadata": {}
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Load necessary modules"
]
],
"metadata": {}
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# show images inline\n",
"%matplotlib inline\n",
Expand All @@ -44,9 +42,6 @@
"%load_ext autoreload\n",
"%autoreload 2\n",
"\n",
"# import keras\n",
"import keras\n",
"\n",
"# import keras_retinanet\n",
"from keras_retinanet import models\n",
"from keras_retinanet.utils.image import read_image_bgr, preprocess_image, resize_image\n",
Expand All @@ -66,22 +61,20 @@
"\n",
"# set the modified tf session as backend in keras\n",
"setup_gpu(gpu)"
]
],
"outputs": [],
"metadata": {}
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Load RetinaNet model"
]
],
"metadata": {}
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": false
},
"outputs": [],
"source": [
"# adjust this to point to your downloaded/trained model\n",
"# models can be downloaded here: https://github.com/lizaalert/lacmus/releases/tag/0.1.1\n",
Expand All @@ -97,20 +90,22 @@
"\n",
"# load label to names mapping for visualization purposes\n",
"labels_to_names = {0: 'Pedestrian'}"
]
],
"outputs": [],
"metadata": {
"scrolled": false
}
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Run detection on example"
]
],
"metadata": {}
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"video_path = 'examples/01.mp4'\n",
"output_path = 'examples/death_circle_output.avi'\n",
Expand All @@ -126,13 +121,13 @@
"num_frames = int(vcapture.get(cv2.CAP_PROP_FRAME_COUNT))\n",
"print(\"Number of Frames: \", num_frames)\n",
"print(\"Original Width, Height: \", width, height)"
]
],
"outputs": [],
"metadata": {}
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def run_detection_video(video_path):\n",
" count = 0\n",
Expand Down Expand Up @@ -185,16 +180,18 @@
" \n",
" print(\"Total Time: \", end - start)\n",
" "
]
],
"outputs": [],
"metadata": {}
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"run_detection_video(video_path)"
]
],
"outputs": [],
"metadata": {}
}
],
"metadata": {
Expand All @@ -218,4 +215,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
14 changes: 0 additions & 14 deletions Server.openvino.dockerfile

This file was deleted.

Empty file removed app/api/v0/__init__.py
Empty file.
Empty file removed app/api/v0/routes/__init__.py
Empty file.
8 changes: 0 additions & 8 deletions app/api/v0/routes/api.py

This file was deleted.

12 changes: 0 additions & 12 deletions app/api/v0/routes/ping.py

This file was deleted.

20 changes: 0 additions & 20 deletions app/api/v0/routes/predict.py

This file was deleted.

Empty file removed app/core/__init__.py
Empty file.
Empty file removed app/core/api_models/__init__.py
Empty file.
16 changes: 0 additions & 16 deletions app/core/api_models/common.py

This file was deleted.

27 changes: 0 additions & 27 deletions app/core/config.py

This file was deleted.

Empty file removed app/core/ml/__init__.py
Empty file.
6 changes: 0 additions & 6 deletions app/core/ml/enum.py

This file was deleted.

123 changes: 0 additions & 123 deletions app/core/ml/retina.py

This file was deleted.

Loading

0 comments on commit 730428a

Please sign in to comment.