Camera 2
56 | 57 |
58 |
59 |
├── tmp_task.py ├── stream ├── __init__.py ├── __pycache__ │ ├── urls.cpython-35.pyc │ ├── urls.cpython-36.pyc │ ├── urls.cpython-37.pyc │ ├── wsgi.cpython-35.pyc │ ├── wsgi.cpython-36.pyc │ ├── wsgi.cpython-37.pyc │ ├── __init__.cpython-35.pyc │ ├── __init__.cpython-36.pyc │ ├── __init__.cpython-37.pyc │ ├── settings.cpython-35.pyc │ ├── settings.cpython-36.pyc │ └── settings.cpython-37.pyc ├── wsgi.py ├── urls.py └── settings.py ├── yolov3_weight └── put_yolo_weight_here.txt ├── webcam ├── models.py ├── tests.py ├── admin.py ├── apps.py ├── templates │ ├── images │ │ ├── japan.jpg │ │ ├── ocst.jpg │ │ ├── team │ │ │ ├── 1.jpg │ │ │ ├── 2.jpg │ │ │ └── 3.jpg │ │ ├── fujifilm.jpg │ │ ├── puppydog.jpg │ │ ├── wooden-desk.jpg │ │ ├── gutman-island.jpg │ │ ├── testimonial01.jpg │ │ ├── testimonial02.jpg │ │ ├── testimonial03.jpg │ │ └── testimonial04.jpg │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ └── fontawesome-webfont.woff │ ├── camera2.html │ ├── index.html │ ├── camera1.html │ └── css │ │ ├── templatemo_style.css │ │ └── font-awesome.min.css ├── __pycache__ │ ├── apps.cpython-37.pyc │ ├── admin.cpython-35.pyc │ ├── admin.cpython-36.pyc │ ├── admin.cpython-37.pyc │ ├── models.cpython-35.pyc │ ├── models.cpython-36.pyc │ ├── models.cpython-37.pyc │ ├── views.cpython-35.pyc │ ├── views.cpython-36.pyc │ ├── views.cpython-37.pyc │ ├── __init__.cpython-35.pyc │ └── __init__.cpython-36.pyc ├── migrations │ └── __pycache__ │ │ ├── __init__.cpython-35.pyc │ │ └── __init__.cpython-36.pyc └── views.py ├── images ├── cam1.png ├── cam2.png └── home.png ├── data ├── anchors │ ├── coco_anchors.txt │ └── basline_anchors.txt ├── classes │ ├── voc.names │ └── coco.names └── dataset │ ├── voc_test.txt │ └── voc_train.txt ├── static ├── images │ ├── japan.jpg │ ├── ocst.jpg │ ├── team │ │ ├── 1.jpg │ │ ├── 2.jpg │ │ └── 3.jpg │ ├── fujifilm.jpg │ ├── puppydog.jpg │ ├── wooden-desk.jpg │ ├── gutman-island.jpg │ ├── testimonial01.jpg │ ├── testimonial02.jpg │ ├── testimonial03.jpg │ └── testimonial04.jpg └── css │ ├── templatemo_style.css │ └── font-awesome.min.css ├── core ├── __pycache__ │ ├── common.cpython-36.pyc │ ├── config.cpython-36.pyc │ ├── utils.cpython-36.pyc │ ├── yolov3.cpython-36.pyc │ ├── __init__.cpython-36.pyc │ └── backbone.cpython-36.pyc ├── config.py ├── backbone.py ├── common.py ├── utils.py ├── dataset.py └── yolov3.py ├── manage.py ├── requirements.txt ├── LICENSE ├── README.md ├── webcam_detection.py └── train.py /tmp_task.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stream/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /yolov3_weight/put_yolo_weight_here.txt: -------------------------------------------------------------------------------- 1 | put_yolo_weight_here!!! -------------------------------------------------------------------------------- /webcam/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /webcam/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /webcam/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /images/cam1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/images/cam1.png -------------------------------------------------------------------------------- /images/cam2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/images/cam2.png -------------------------------------------------------------------------------- /images/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/images/home.png -------------------------------------------------------------------------------- /data/anchors/coco_anchors.txt: -------------------------------------------------------------------------------- 1 | 10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326 2 | -------------------------------------------------------------------------------- /static/images/japan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/static/images/japan.jpg -------------------------------------------------------------------------------- /static/images/ocst.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/static/images/ocst.jpg -------------------------------------------------------------------------------- /static/images/team/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/static/images/team/1.jpg -------------------------------------------------------------------------------- /static/images/team/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/static/images/team/2.jpg -------------------------------------------------------------------------------- /static/images/team/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/static/images/team/3.jpg -------------------------------------------------------------------------------- /static/images/fujifilm.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/static/images/fujifilm.jpg -------------------------------------------------------------------------------- /static/images/puppydog.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/static/images/puppydog.jpg -------------------------------------------------------------------------------- /webcam/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class WebcamConfig(AppConfig): 5 | name = 'webcam' 6 | -------------------------------------------------------------------------------- /static/images/wooden-desk.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/static/images/wooden-desk.jpg -------------------------------------------------------------------------------- /static/images/gutman-island.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/static/images/gutman-island.jpg -------------------------------------------------------------------------------- /static/images/testimonial01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/static/images/testimonial01.jpg -------------------------------------------------------------------------------- /static/images/testimonial02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/static/images/testimonial02.jpg -------------------------------------------------------------------------------- /static/images/testimonial03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/static/images/testimonial03.jpg -------------------------------------------------------------------------------- /static/images/testimonial04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/static/images/testimonial04.jpg -------------------------------------------------------------------------------- /webcam/templates/images/japan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/templates/images/japan.jpg -------------------------------------------------------------------------------- /webcam/templates/images/ocst.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/templates/images/ocst.jpg -------------------------------------------------------------------------------- /webcam/templates/images/team/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/templates/images/team/1.jpg -------------------------------------------------------------------------------- /webcam/templates/images/team/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/templates/images/team/2.jpg -------------------------------------------------------------------------------- /webcam/templates/images/team/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/templates/images/team/3.jpg -------------------------------------------------------------------------------- /core/__pycache__/common.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/core/__pycache__/common.cpython-36.pyc -------------------------------------------------------------------------------- /core/__pycache__/config.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/core/__pycache__/config.cpython-36.pyc -------------------------------------------------------------------------------- /core/__pycache__/utils.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/core/__pycache__/utils.cpython-36.pyc -------------------------------------------------------------------------------- /core/__pycache__/yolov3.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/core/__pycache__/yolov3.cpython-36.pyc -------------------------------------------------------------------------------- /stream/__pycache__/urls.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/stream/__pycache__/urls.cpython-35.pyc -------------------------------------------------------------------------------- /stream/__pycache__/urls.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/stream/__pycache__/urls.cpython-36.pyc -------------------------------------------------------------------------------- /stream/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/stream/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /stream/__pycache__/wsgi.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/stream/__pycache__/wsgi.cpython-35.pyc -------------------------------------------------------------------------------- /stream/__pycache__/wsgi.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/stream/__pycache__/wsgi.cpython-36.pyc -------------------------------------------------------------------------------- /stream/__pycache__/wsgi.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/stream/__pycache__/wsgi.cpython-37.pyc -------------------------------------------------------------------------------- /webcam/__pycache__/apps.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/__pycache__/apps.cpython-37.pyc -------------------------------------------------------------------------------- /webcam/templates/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/templates/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /webcam/templates/images/fujifilm.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/templates/images/fujifilm.jpg -------------------------------------------------------------------------------- /webcam/templates/images/puppydog.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/templates/images/puppydog.jpg -------------------------------------------------------------------------------- /core/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/core/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /core/__pycache__/backbone.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/core/__pycache__/backbone.cpython-36.pyc -------------------------------------------------------------------------------- /webcam/__pycache__/admin.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/__pycache__/admin.cpython-35.pyc -------------------------------------------------------------------------------- /webcam/__pycache__/admin.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/__pycache__/admin.cpython-36.pyc -------------------------------------------------------------------------------- /webcam/__pycache__/admin.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/__pycache__/admin.cpython-37.pyc -------------------------------------------------------------------------------- /webcam/__pycache__/models.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/__pycache__/models.cpython-35.pyc -------------------------------------------------------------------------------- /webcam/__pycache__/models.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/__pycache__/models.cpython-36.pyc -------------------------------------------------------------------------------- /webcam/__pycache__/models.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/__pycache__/models.cpython-37.pyc -------------------------------------------------------------------------------- /webcam/__pycache__/views.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/__pycache__/views.cpython-35.pyc -------------------------------------------------------------------------------- /webcam/__pycache__/views.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/__pycache__/views.cpython-36.pyc -------------------------------------------------------------------------------- /webcam/__pycache__/views.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/__pycache__/views.cpython-37.pyc -------------------------------------------------------------------------------- /webcam/templates/images/wooden-desk.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/templates/images/wooden-desk.jpg -------------------------------------------------------------------------------- /stream/__pycache__/__init__.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/stream/__pycache__/__init__.cpython-35.pyc -------------------------------------------------------------------------------- /stream/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/stream/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /stream/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/stream/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /stream/__pycache__/settings.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/stream/__pycache__/settings.cpython-35.pyc -------------------------------------------------------------------------------- /stream/__pycache__/settings.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/stream/__pycache__/settings.cpython-36.pyc -------------------------------------------------------------------------------- /stream/__pycache__/settings.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/stream/__pycache__/settings.cpython-37.pyc -------------------------------------------------------------------------------- /webcam/__pycache__/__init__.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/__pycache__/__init__.cpython-35.pyc -------------------------------------------------------------------------------- /webcam/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /webcam/templates/images/gutman-island.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/templates/images/gutman-island.jpg -------------------------------------------------------------------------------- /webcam/templates/images/testimonial01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/templates/images/testimonial01.jpg -------------------------------------------------------------------------------- /webcam/templates/images/testimonial02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/templates/images/testimonial02.jpg -------------------------------------------------------------------------------- /webcam/templates/images/testimonial03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/templates/images/testimonial03.jpg -------------------------------------------------------------------------------- /webcam/templates/images/testimonial04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/templates/images/testimonial04.jpg -------------------------------------------------------------------------------- /data/anchors/basline_anchors.txt: -------------------------------------------------------------------------------- 1 | 1.25,1.625, 2.0,3.75, 4.125,2.875, 1.875,3.8125, 3.875,2.8125, 3.6875,7.4375, 3.625,2.8125, 4.875,6.1875, 11.65625,10.1875 2 | -------------------------------------------------------------------------------- /webcam/templates/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/templates/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /webcam/templates/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/templates/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /webcam/templates/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/templates/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /webcam/migrations/__pycache__/__init__.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/migrations/__pycache__/__init__.cpython-35.pyc -------------------------------------------------------------------------------- /webcam/migrations/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tranleanh/yolo-django-streaming/HEAD/webcam/migrations/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /data/classes/voc.names: -------------------------------------------------------------------------------- 1 | aeroplane 2 | bicycle 3 | bird 4 | boat 5 | bottle 6 | bus 7 | car 8 | cat 9 | chair 10 | cow 11 | diningtable 12 | dog 13 | horse 14 | motorbike 15 | person 16 | pottedplant 17 | sheep 18 | sofa 19 | train 20 | tvmonitor -------------------------------------------------------------------------------- /stream/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for stream project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'stream.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'stream.settings') 9 | try: 10 | from django.core.management import execute_from_command_line 11 | except ImportError as exc: 12 | raise ImportError( 13 | "Couldn't import Django. Are you sure it's installed and " 14 | "available on your PYTHONPATH environment variable? Did you " 15 | "forget to activate a virtual environment?" 16 | ) from exc 17 | execute_from_command_line(sys.argv) 18 | 19 | 20 | if __name__ == '__main__': 21 | main() 22 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | absl-py==0.13.0 2 | asgiref==3.4.1 3 | astor==0.8.1 4 | cached-property==1.5.2 5 | Django==3.2.5 6 | easydict==1.9 7 | gast==0.2.2 8 | google-pasta==0.2.0 9 | grpcio==1.39.0 10 | h5py==3.3.0 11 | importlib-metadata==4.6.1 12 | Keras-Applications==1.0.8 13 | Keras-Preprocessing==1.1.2 14 | Markdown==3.3.4 15 | mysqlclient==2.0.3 16 | numpy==1.21.1 17 | opencv-python==4.5.3.56 18 | opt-einsum==3.3.0 19 | Pillow==8.3.1 20 | protobuf==3.17.3 21 | pytz==2021.1 22 | six==1.16.0 23 | sqlparse==0.4.1 24 | tensorboard==1.15.0 25 | tensorflow==1.15.0 26 | tensorflow-estimator==1.15.1 27 | termcolor==1.1.0 28 | typing-extensions==3.10.0.0 29 | Werkzeug==2.0.1 30 | wrapt==1.12.1 31 | zipp==3.5.0 32 | -------------------------------------------------------------------------------- /data/classes/coco.names: -------------------------------------------------------------------------------- 1 | person 2 | bicycle 3 | car 4 | motorbike 5 | aeroplane 6 | bus 7 | train 8 | truck 9 | boat 10 | traffic light 11 | fire hydrant 12 | stop sign 13 | parking meter 14 | bench 15 | bird 16 | cat 17 | dog 18 | horse 19 | sheep 20 | cow 21 | elephant 22 | bear 23 | zebra 24 | giraffe 25 | backpack 26 | umbrella 27 | handbag 28 | tie 29 | suitcase 30 | frisbee 31 | skis 32 | snowboard 33 | sports ball 34 | kite 35 | baseball bat 36 | baseball glove 37 | skateboard 38 | surfboard 39 | tennis racket 40 | bottle 41 | wine glass 42 | cup 43 | fork 44 | knife 45 | spoon 46 | bowl 47 | banana 48 | apple 49 | sandwich 50 | orange 51 | broccoli 52 | carrot 53 | hot dog 54 | pizza 55 | donut 56 | cake 57 | chair 58 | sofa 59 | pottedplant 60 | bed 61 | diningtable 62 | toilet 63 | tvmonitor 64 | laptop 65 | mouse 66 | remote 67 | keyboard 68 | cell phone 69 | microwave 70 | oven 71 | toaster 72 | sink 73 | refrigerator 74 | book 75 | clock 76 | vase 77 | scissors 78 | teddy bear 79 | hair drier 80 | toothbrush 81 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 LA Tran 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /stream/urls.py: -------------------------------------------------------------------------------- 1 | """stream URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/2.2/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | # 2019-07-23 Modified by Tran Le Anh 17 | 18 | from django.contrib import admin 19 | from django.urls import path 20 | from webcam.views import index, video_feed_1, video_feed_2, camera_1, camera_2 21 | # from webcam.views import database, search 22 | 23 | urlpatterns = [ 24 | path('admin/', admin.site.urls), 25 | path('index/', index), 26 | path('video_feed_1/', video_feed_1, name="video-feed-1"), 27 | path('video_feed_2/', video_feed_2, name="video-feed-2"), 28 | path('index/camera1/', camera_1), 29 | path('index/camera2/', camera_2), 30 | # path('index/database/', database), 31 | # path('index/database/50latest', database), 32 | # path('index/database/search', search), 33 | ] 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # yolov3-django-streaming 2 | 3 | This project is to stream object detection (yolov3) with 2 cameras (2 switchable channels) on web browser using Django framework. 4 | 5 | The project can be deployed on Ubuntu and Windows. 6 | 7 | Watch final result: https://www.youtube.com/watch?v=SDnpNd7xRbE&t=10s 8 | 9 | ## 1. Steps to use 10 | 1. Download file "yolov3_coco.pb" from the link below and locate it in folder "yolov3_weight": ([gotolink](https://drive.google.com/drive/u/1/folders/1apB-yPIxxzC9D6_iAaQrXWuGpbWIK6Lp)) 11 | ```bashrc 12 | https://drive.google.com/drive/u/1/folders/1apB-yPIxxzC9D6_iAaQrXWuGpbWIK6Lp 13 | ``` 14 | 2. Create your virtual environment and install required packages: 15 | ```bashrc 16 | $ pip install -r requirements.txt 17 | ``` 18 | 3. Run program: 19 | ```bashrc 20 | $ python manage.py runserver 21 | ``` 22 | 4. Open any web browser and navigate to URL (home page): 23 | ```bashrc 24 | http://127.0.0.1:8000/index 25 | ``` 26 | ## 2. What should happen then? 27 | (don't worry, my face will not be on your screen) 28 | - Camera 1: 29 | 30 |  31 | 32 | - Camera 2: 33 | 34 |  35 | 36 | ## 3. Be careful 37 | - The 2 camera ids in the source code are "0" and "2" (for my computer). 38 | - You should change them for running on any other computers. Go to webcam/views.py then find and change "cam_id" parameter. 39 | 40 | 41 | ## Acknowledgement 42 | - The yolov3 implementation was borrowed from [YunYang1994](https://github.com/YunYang1994/tensorflow-yolov3) 43 | 44 | 45 | ## Cite This Project 46 | ```bashrc 47 | @article{tran2020yolostream, 48 | title={Object Detection Streaming and Data Management on Web Browser}, 49 | author={Tran, Le-Anh}, 50 | journal={Technical Report}, 51 | year={2020} 52 | } 53 | ``` 54 | 55 | Good luck. 56 | 57 | Created on July 11, 2019. 58 | 59 | Last update on July 22, 2021. (because I had received tons of emails for fixing this project, thanks) 60 | 61 | Tran Le Anh ([LA Tran](https://sites.google.com/view/leanhtran/)) 62 | 63 | -------------------------------------------------------------------------------- /data/dataset/voc_test.txt: -------------------------------------------------------------------------------- 1 | /home/yang/test/VOC/test/VOCdevkit/VOC2007/JPEGImages/000001.jpg 48,240,195,371,11 8,12,352,498,14 2 | /home/yang/test/VOC/test/VOCdevkit/VOC2007/JPEGImages/000002.jpg 139,200,207,301,18 3 | /home/yang/test/VOC/test/VOCdevkit/VOC2007/JPEGImages/000003.jpg 123,155,215,195,17 239,156,307,205,8 4 | /home/yang/test/VOC/test/VOCdevkit/VOC2007/JPEGImages/000004.jpg 13,311,84,362,6 362,330,500,389,6 235,328,334,375,6 175,327,252,364,6 139,320,189,359,6 108,325,150,353,6 84,323,121,350,6 5 | /home/yang/test/VOC/test/VOCdevkit/VOC2007/JPEGImages/000006.jpg 187,135,282,242,15 154,209,369,375,10 255,207,366,375,8 138,211,249,375,8 6 | /home/yang/test/VOC/test/VOCdevkit/VOC2007/JPEGImages/000008.jpg 192,16,364,249,8 7 | /home/yang/test/VOC/test/VOCdevkit/VOC2007/JPEGImages/000010.jpg 87,97,258,427,12 133,72,245,284,14 8 | /home/yang/test/VOC/test/VOCdevkit/VOC2007/JPEGImages/000011.jpg 126,51,330,308,7 9 | /home/yang/test/VOC/test/VOCdevkit/VOC2007/JPEGImages/000013.jpg 299,160,446,252,9 10 | /home/yang/test/VOC/test/VOCdevkit/VOC2007/JPEGImages/000014.jpg 72,163,302,228,5 185,194,500,316,6 416,180,500,222,6 314,8,344,65,14 331,4,361,61,14 357,8,401,61,14 11 | /home/yang/test/VOC/test/VOCdevkit/VOC2007/JPEGImages/000015.jpg 77,136,360,358,1 12 | /home/yang/test/VOC/test/VOCdevkit/VOC2007/JPEGImages/000018.jpg 31,30,358,279,11 13 | /home/yang/test/VOC/test/VOCdevkit/VOC2007/JPEGImages/000022.jpg 68,103,368,283,12 186,44,255,230,14 14 | /home/yang/test/VOC/test/VOCdevkit/VOC2007/JPEGImages/000025.jpg 2,84,59,248,9 68,115,233,279,9 64,173,377,373,9 320,2,496,375,14 221,4,341,374,14 135,14,220,148,14 69,43,156,177,9 58,54,104,139,14 279,1,331,86,14 320,22,344,96,14 15 | /home/yang/test/VOC/test/VOCdevkit/VOC2007/JPEGImages/000027.jpg 174,101,349,351,14 16 | /home/yang/test/VOC/test/VOCdevkit/VOC2007/JPEGImages/000028.jpg 63,18,374,500,7 17 | /home/yang/test/VOC/test/VOCdevkit/VOC2007/JPEGImages/000029.jpg 56,63,284,290,11 18 | /home/yang/test/VOC/test/VOCdevkit/VOC2007/JPEGImages/000031.jpg 41,77,430,255,18 19 | /home/yang/test/VOC/test/VOCdevkit/VOC2007/JPEGImages/000037.jpg 61,96,464,339,11 20 | -------------------------------------------------------------------------------- /data/dataset/voc_train.txt: -------------------------------------------------------------------------------- 1 | /home/yang/test/VOC/train/VOCdevkit/VOC2007/JPEGImages/000005.jpg 263,211,324,339,8 165,264,253,372,8 241,194,295,299,8 2 | /home/yang/test/VOC/train/VOCdevkit/VOC2007/JPEGImages/000007.jpg 141,50,500,330,6 3 | /home/yang/test/VOC/train/VOCdevkit/VOC2007/JPEGImages/000009.jpg 69,172,270,330,12 150,141,229,284,14 285,201,327,331,14 258,198,297,329,14 4 | /home/yang/test/VOC/train/VOCdevkit/VOC2007/JPEGImages/000012.jpg 156,97,351,270,6 5 | /home/yang/test/VOC/train/VOCdevkit/VOC2007/JPEGImages/000016.jpg 92,72,305,473,1 6 | /home/yang/test/VOC/train/VOCdevkit/VOC2007/JPEGImages/000017.jpg 185,62,279,199,14 90,78,403,336,12 7 | /home/yang/test/VOC/train/VOCdevkit/VOC2007/JPEGImages/000019.jpg 231,88,483,256,7 11,113,266,259,7 8 | /home/yang/test/VOC/train/VOCdevkit/VOC2007/JPEGImages/000020.jpg 33,148,371,416,6 9 | /home/yang/test/VOC/train/VOCdevkit/VOC2007/JPEGImages/000021.jpg 1,235,182,388,11 210,36,336,482,14 46,82,170,365,14 11,181,142,419,14 10 | /home/yang/test/VOC/train/VOCdevkit/VOC2007/JPEGImages/000023.jpg 9,230,245,500,1 230,220,334,500,1 2,1,117,369,14 3,2,243,462,14 225,1,334,486,14 11 | /home/yang/test/VOC/train/VOCdevkit/VOC2007/JPEGImages/000024.jpg 196,165,489,247,18 12 | /home/yang/test/VOC/train/VOCdevkit/VOC2007/JPEGImages/000026.jpg 90,125,337,212,6 13 | /home/yang/test/VOC/train/VOCdevkit/VOC2007/JPEGImages/000030.jpg 36,205,180,289,1 51,160,150,292,14 295,138,450,290,14 14 | /home/yang/test/VOC/train/VOCdevkit/VOC2007/JPEGImages/000032.jpg 104,78,375,183,0 133,88,197,123,0 195,180,213,229,14 26,189,44,238,14 15 | /home/yang/test/VOC/train/VOCdevkit/VOC2007/JPEGImages/000033.jpg 9,107,499,263,0 421,200,482,226,0 325,188,411,223,0 16 | /home/yang/test/VOC/train/VOCdevkit/VOC2007/JPEGImages/000034.jpg 116,167,360,400,18 141,153,333,229,18 17 | /home/yang/test/VOC/train/VOCdevkit/VOC2007/JPEGImages/000035.jpg 1,96,191,361,14 218,98,465,318,14 18 | /home/yang/test/VOC/train/VOCdevkit/VOC2007/JPEGImages/000036.jpg 27,79,319,344,11 19 | /home/yang/test/VOC/train/VOCdevkit/VOC2007/JPEGImages/000039.jpg 156,89,344,279,19 20 | /home/yang/test/VOC/train/VOCdevkit/VOC2007/JPEGImages/000041.jpg 363,47,432,107,19 216,92,307,302,14 164,148,227,244,14 21 | -------------------------------------------------------------------------------- /core/config.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | # coding=utf-8 3 | #================================================================ 4 | # Copyright (C) 2019 * Ltd. All rights reserved. 5 | # 6 | # Editor : VIM 7 | # File name : config.py 8 | # Author : YunYang1994 9 | # Created date: 2019-02-28 13:06:54 10 | # Description : 11 | # 12 | #================================================================ 13 | 14 | from easydict import EasyDict as edict 15 | 16 | 17 | __C = edict() 18 | # Consumers can get config by: from config import cfg 19 | 20 | cfg = __C 21 | 22 | # YOLO options 23 | __C.YOLO = edict() 24 | 25 | # Set the class name 26 | __C.YOLO.CLASSES = "./data/classes/coco.names" 27 | __C.YOLO.ANCHORS = "./data/anchors/basline_anchors.txt" 28 | __C.YOLO.MOVING_AVE_DECAY = 0.9995 29 | __C.YOLO.STRIDES = [8, 16, 32] 30 | __C.YOLO.ANCHOR_PER_SCALE = 3 31 | __C.YOLO.IOU_LOSS_THRESH = 0.5 32 | __C.YOLO.UPSAMPLE_METHOD = "resize" 33 | __C.YOLO.ORIGINAL_WEIGHT = "./checkpoint/yolov3_coco.ckpt" 34 | __C.YOLO.DEMO_WEIGHT = "./checkpoint/yolov3_coco_demo.ckpt" 35 | 36 | # Train options 37 | __C.TRAIN = edict() 38 | 39 | __C.TRAIN.ANNOT_PATH = "./data/dataset/voc_train.txt" 40 | __C.TRAIN.BATCH_SIZE = 6 41 | __C.TRAIN.INPUT_SIZE = [320, 352, 384, 416, 448, 480, 512, 544, 576, 608] 42 | __C.TRAIN.DATA_AUG = True 43 | __C.TRAIN.LEARN_RATE_INIT = 1e-4 44 | __C.TRAIN.LEARN_RATE_END = 1e-6 45 | __C.TRAIN.WARMUP_EPOCHS = 2 46 | __C.TRAIN.FISRT_STAGE_EPOCHS = 20 47 | __C.TRAIN.SECOND_STAGE_EPOCHS = 30 48 | __C.TRAIN.INITIAL_WEIGHT = "./checkpoint/yolov3_coco_demo.ckpt" 49 | 50 | 51 | 52 | # TEST options 53 | __C.TEST = edict() 54 | 55 | __C.TEST.ANNOT_PATH = "./data/dataset/voc_test.txt" 56 | __C.TEST.BATCH_SIZE = 2 57 | __C.TEST.INPUT_SIZE = 544 58 | __C.TEST.DATA_AUG = False 59 | __C.TEST.WRITE_IMAGE = True 60 | __C.TEST.WRITE_IMAGE_PATH = "./data/detection/" 61 | __C.TEST.WRITE_IMAGE_SHOW_LABEL = False 62 | __C.TEST.WEIGHT_FILE = "./checkpoint/yolov3_test_loss=9.2099.ckpt-5" 63 | __C.TEST.SHOW_LABEL = False 64 | __C.TEST.SCORE_THRESHOLD = 0.3 65 | __C.TEST.IOU_THRESHOLD = 0.45 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /core/backbone.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | # coding=utf-8 3 | #================================================================ 4 | # Copyright (C) 2019 * Ltd. All rights reserved. 5 | # 6 | # Editor : VIM 7 | # File name : backbone.py 8 | # Author : YunYang1994 9 | # Created date: 2019-02-17 11:03:35 10 | # Description : 11 | # 12 | #================================================================ 13 | 14 | import core.common as common 15 | import tensorflow as tf 16 | 17 | 18 | def darknet53(input_data, trainable): 19 | 20 | with tf.variable_scope('darknet'): 21 | 22 | input_data = common.convolutional(input_data, filters_shape=(3, 3, 3, 32), trainable=trainable, name='conv0') 23 | input_data = common.convolutional(input_data, filters_shape=(3, 3, 32, 64), 24 | trainable=trainable, name='conv1', downsample=True) 25 | 26 | for i in range(1): 27 | input_data = common.residual_block(input_data, 64, 32, 64, trainable=trainable, name='residual%d' %(i+0)) 28 | 29 | input_data = common.convolutional(input_data, filters_shape=(3, 3, 64, 128), 30 | trainable=trainable, name='conv4', downsample=True) 31 | 32 | for i in range(2): 33 | input_data = common.residual_block(input_data, 128, 64, 128, trainable=trainable, name='residual%d' %(i+1)) 34 | 35 | input_data = common.convolutional(input_data, filters_shape=(3, 3, 128, 256), 36 | trainable=trainable, name='conv9', downsample=True) 37 | 38 | for i in range(8): 39 | input_data = common.residual_block(input_data, 256, 128, 256, trainable=trainable, name='residual%d' %(i+3)) 40 | 41 | route_1 = input_data 42 | input_data = common.convolutional(input_data, filters_shape=(3, 3, 256, 512), 43 | trainable=trainable, name='conv26', downsample=True) 44 | 45 | for i in range(8): 46 | input_data = common.residual_block(input_data, 512, 256, 512, trainable=trainable, name='residual%d' %(i+11)) 47 | 48 | route_2 = input_data 49 | input_data = common.convolutional(input_data, filters_shape=(3, 3, 512, 1024), 50 | trainable=trainable, name='conv43', downsample=True) 51 | 52 | for i in range(4): 53 | input_data = common.residual_block(input_data, 1024, 512, 1024, trainable=trainable, name='residual%d' %(i+19)) 54 | 55 | return route_1, route_2, input_data 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /webcam/templates/camera2.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 8 |
58 |
59 |