Skip to content

Commit

Permalink
v1
Browse files Browse the repository at this point in the history
  • Loading branch information
snowby666 committed Aug 1, 2023
0 parents commit 5869381
Show file tree
Hide file tree
Showing 1,330 changed files with 245,937 additions and 0 deletions.
Empty file added VideoStream/__init__.py
Empty file.
Binary file added VideoStream/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file added VideoStream/__pycache__/asgi.cpython-39.pyc
Binary file not shown.
Binary file added VideoStream/__pycache__/settings.cpython-39.pyc
Binary file not shown.
Binary file added VideoStream/__pycache__/urls.cpython-39.pyc
Binary file not shown.
Binary file added VideoStream/__pycache__/wsgi.cpython-39.pyc
Binary file not shown.
28 changes: 28 additions & 0 deletions VideoStream/asgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import os

from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.security.websocket import AllowedHostsOriginValidator
from django.core.asgi import get_asgi_application
from django.urls import path

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "VideoStream.settings")
# Initialize Django ASGI application early to ensure the AppRegistry
# is populated before importing code that may import ORM models.
django_asgi_app = get_asgi_application()

from server.views import VideoStreamConsumer

application = ProtocolTypeRouter({
# Django's ASGI application to handle traditional HTTP requests
"http": django_asgi_app,

# WebSocket chat handler
"websocket": AllowedHostsOriginValidator(
AuthMiddlewareStack(
URLRouter([
path("", VideoStreamConsumer.as_asgi()),
])
)
),
})
157 changes: 157 additions & 0 deletions VideoStream/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
"""
Django settings for VideoStream project.
Generated by 'django-admin startproject' using Django 4.1.
For more information on this file, see
https://docs.djangoproject.com/en/4.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.1/ref/settings/
"""

from pathlib import Path
import os
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-v70=a$+6rwm8zctj#g_@@djpty@01m1ob_kj5ex13$pn)-1loq'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ['*']

# Application definition

INSTALLED_APPS = [
'channels',
'corsheaders',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'server.apps.ServerConfig',
'django.contrib.humanize',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'VideoStream.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'VideoStream.wsgi.application'


# Database
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}


# Password validation
# https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/4.1/topics/i18n/


LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'Asia/Ho_Chi_Minh'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.1/howto/static-files/

# Default primary key field type
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

STATIC_URL = '/server/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')

STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"

CORS_ALLOW_ALL_ORIGINS = True
CSRF_TRUSTED_ORIGINS = ['http://127.0.0.1:8000','http://localhost:8000/']
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

# Uncomment this line if you want to force HTTPS when deploying to production
# SECURE_SSL_REDIRECT = True

# Channels
ASGI_APPLICATION = 'routing.application'
CHANNEL_LAYERS={
"default": {
"BACKEND": "channels.layers.InMemoryChannelLayer"
}
}

# CHANNEL_LAYERS = {
# "default": {
# "BACKEND": "channels_redis.core.RedisChannelLayer",
# "CONFIG": {
# "hosts": [("127.0.0.1", 6379)],
# },
# },
# }
24 changes: 24 additions & 0 deletions VideoStream/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""VideoStream URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from django.conf.urls.static import static
from django.conf import settings
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('server.urls')),
]+static(settings.STATIC_URL,
document_root=settings.STATIC_ROOT)
16 changes: 16 additions & 0 deletions VideoStream/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
WSGI config for VideoStream project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.1/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'VideoStream.settings')

application = get_wsgi_application()
Binary file added db.sqlite3
Binary file not shown.
Binary file added dlib-19.22.99-cp39-cp39-win_amd64.whl
Binary file not shown.
22 changes: 22 additions & 0 deletions manage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys


def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'VideoStream.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)


if __name__ == '__main__':
main()
52 changes: 52 additions & 0 deletions ngrok.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<NgrokTunnel: \"http://f68c-113-173-152-77.ngrok.io\" -> \"http://localhost:7000\">"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from pyngrok import ngrok\n",
"ngrok.kill()\n",
"# You can get your authtoken from https://dashboard.ngrok.com/auth\n",
"auth_token = '2MBBpglFtyIYedSYhqf3J9qadxk_3aCaoe72L8oBJZbm8kmMo' # I prepared this for you, but you can get your own\n",
"ngrok.set_auth_token(auth_token)\n",
"\n",
"ngrok.connect(8000) # You can change the port number if you want"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}
25 changes: 25 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
boost==0.1
cmake==3.25.0
Click>=6.0

Django==4.1
django-cors-headers
DateTime==4.5

numpy==1.23.3
opencv-python==4.5.3.56
#dlib==19.23.0
./dlib-19.22.99-cp39-cp39-win_amd64.whl

imutils==0.5.3
requests>=2.20.0
tensorflow==2.7.2
keras==2.7.0
Pillow==9.0.1
requests-html==0.10.0
channels==4.0.0
daphne==2.5.0
whitenoise==6.4.0
psycopg2-binary
protobuf==3.20.*
pyngrok==5.2.1
Empty file added server/__init__.py
Empty file.
Binary file added server/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file added server/__pycache__/admin.cpython-39.pyc
Binary file not shown.
Binary file added server/__pycache__/apps.cpython-39.pyc
Binary file not shown.
Binary file added server/__pycache__/models.cpython-39.pyc
Binary file not shown.
Binary file added server/__pycache__/urls.cpython-39.pyc
Binary file not shown.
Binary file added server/__pycache__/views.cpython-39.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions server/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions server/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class ServerConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'server'
Empty file added server/migrations/__init__.py
Empty file.
Binary file not shown.
3 changes: 3 additions & 0 deletions server/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
Binary file added server/models/_mini_XCEPTION.102-0.66.hdf5
Binary file not shown.
Binary file not shown.
7 changes: 7 additions & 0 deletions server/static/server/c3/.bmp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
version: 0.7.20
commit: 'chore(version): bump to v%.%.%'
files:
src/core.ts: 'version: ''%.%.%'''
package.json: '"version": "%.%.%"'
component.json: '"version": "%.%.%"'
Loading

0 comments on commit 5869381

Please sign in to comment.