Aryan6192 commited on
Commit
dd619d6
·
verified ·
1 Parent(s): fe9c4ce

Upload 1575 files

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .dockerignore +37 -0
  2. .gitattributes +39 -0
  3. .gitignore +10 -0
  4. Dockerfile +22 -0
  5. README.md +83 -10
  6. bin/gunicorn_start.sh +17 -0
  7. db.sqlite3 +0 -0
  8. manage.py +21 -0
  9. ml_app/__init__.py +0 -0
  10. ml_app/__pycache__/__init__.cpython-36.pyc +0 -0
  11. ml_app/__pycache__/__init__.cpython-38.pyc +0 -0
  12. ml_app/__pycache__/apps.cpython-36.pyc +0 -0
  13. ml_app/__pycache__/apps.cpython-38.pyc +0 -0
  14. ml_app/__pycache__/forms.cpython-36.pyc +0 -0
  15. ml_app/__pycache__/forms.cpython-38.pyc +0 -0
  16. ml_app/__pycache__/models.cpython-36.pyc +0 -0
  17. ml_app/__pycache__/models.cpython-38.pyc +0 -0
  18. ml_app/__pycache__/urls.cpython-36.pyc +0 -0
  19. ml_app/__pycache__/urls.cpython-38.pyc +0 -0
  20. ml_app/__pycache__/views.cpython-36.pyc +0 -0
  21. ml_app/__pycache__/views.cpython-38.pyc +0 -0
  22. ml_app/admin.py +3 -0
  23. ml_app/apps.py +5 -0
  24. ml_app/forms.py +6 -0
  25. ml_app/models.py +3 -0
  26. ml_app/templates/404.html +422 -0
  27. ml_app/templates/about.html +4 -0
  28. ml_app/templates/cuda_full.html +422 -0
  29. ml_app/templates/index.html +71 -0
  30. ml_app/templates/predict.html +110 -0
  31. ml_app/tests.py +3 -0
  32. ml_app/urls.py +16 -0
  33. ml_app/views.py +392 -0
  34. models/model_95_acc_40_frames_FF_data.pt +3 -0
  35. nginx/Dockerfile +5 -0
  36. nginx/nginx.conf +31 -0
  37. project_settings/__init__.py +0 -0
  38. project_settings/__pycache__/__init__.cpython-36.pyc +0 -0
  39. project_settings/__pycache__/__init__.cpython-38.pyc +0 -0
  40. project_settings/__pycache__/settings.cpython-36.pyc +0 -0
  41. project_settings/__pycache__/settings.cpython-38.pyc +0 -0
  42. project_settings/__pycache__/urls.cpython-36.pyc +0 -0
  43. project_settings/__pycache__/urls.cpython-38.pyc +0 -0
  44. project_settings/__pycache__/wsgi.cpython-36.pyc +0 -0
  45. project_settings/__pycache__/wsgi.cpython-38.pyc +0 -0
  46. project_settings/asgi.py +16 -0
  47. project_settings/settings.py +135 -0
  48. project_settings/urls.py +11 -0
  49. project_settings/wsgi.py +16 -0
  50. requirements.txt +101 -0
.dockerignore ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ignore a file or directory in the context root named "modules"
2
+ venv
3
+
4
+ # Ignore any files or directories within the subdirectory named "modules"
5
+ # in the context root
6
+ venv/*
7
+
8
+ # Ignore any files or directories in the context root beginning with "modules"
9
+ venv*
10
+
11
+ # Ignore any files or directories one level down from the context root named
12
+ # "modules"
13
+ */venv
14
+
15
+ # Ignore any files or directories at any level, including the context root,
16
+ # named modules
17
+ **/venv
18
+
19
+ # Git
20
+ .git
21
+ .gitignore
22
+
23
+ # Docker
24
+ .docker
25
+
26
+ # Python
27
+ __pycache__
28
+ app/__pycache__/
29
+ app/*/__pycache__/
30
+ app/*/*/__pycache__/
31
+ app/*/*/*/__pycache__/
32
+ .env/
33
+ .venv/
34
+ venv/
35
+
36
+ # Local PostgreSQL data
37
+ data/
.gitattributes CHANGED
@@ -33,3 +33,42 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ static/images/background.png filter=lfs diff=lfs merge=lfs -text
37
+ static/images/background1.png filter=lfs diff=lfs merge=lfs -text
38
+ static/json/age_gender_model-shard1 filter=lfs diff=lfs merge=lfs -text
39
+ static/json/face_expression_model-shard1 filter=lfs diff=lfs merge=lfs -text
40
+ static/json/face_landmark_68_model-shard1 filter=lfs diff=lfs merge=lfs -text
41
+ static/json/face_recognition_model-shard1 filter=lfs diff=lfs merge=lfs -text
42
+ static/json/face_recognition_model-shard2 filter=lfs diff=lfs merge=lfs -text
43
+ static/json/mtcnn_model-shard1 filter=lfs diff=lfs merge=lfs -text
44
+ static/json/ssd_mobilenetv1_model-shard1 filter=lfs diff=lfs merge=lfs -text
45
+ static/json/ssd_mobilenetv1_model-shard2 filter=lfs diff=lfs merge=lfs -text
46
+ static/json/tiny_face_detector_model-shard1 filter=lfs diff=lfs merge=lfs -text
47
+ venv/Lib/site-packages/pip/_vendor/chardet/__pycache__/langrussianmodel.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
48
+ venv/Lib/site-packages/pip/_vendor/distlib/t64-arm.exe filter=lfs diff=lfs merge=lfs -text
49
+ venv/Lib/site-packages/pip/_vendor/distlib/t64.exe filter=lfs diff=lfs merge=lfs -text
50
+ venv/Lib/site-packages/pip/_vendor/distlib/w64-arm.exe filter=lfs diff=lfs merge=lfs -text
51
+ venv/Lib/site-packages/pip/_vendor/distlib/w64.exe filter=lfs diff=lfs merge=lfs -text
52
+ venv/Lib/site-packages/pip/_vendor/idna/__pycache__/uts46data.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
53
+ venv/Lib/site-packages/pip/_vendor/pkg_resources/__pycache__/__init__.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
54
+ venv/Lib/site-packages/pip/_vendor/pyparsing/__pycache__/core.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
55
+ venv/Lib/site-packages/pip/_vendor/rich/__pycache__/_emoji_codes.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
56
+ venv/Lib/site-packages/pip/_vendor/rich/__pycache__/console.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
57
+ venv/Lib/site-packages/pkg_resources/__pycache__/__init__.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
58
+ venv/Lib/site-packages/pkg_resources/_vendor/more_itertools/__pycache__/more.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
59
+ venv/Lib/site-packages/pkg_resources/_vendor/pyparsing/__pycache__/core.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
60
+ venv/Lib/site-packages/setuptools/_vendor/__pycache__/typing_extensions.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
61
+ venv/Lib/site-packages/setuptools/_vendor/more_itertools/__pycache__/more.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
62
+ venv/Lib/site-packages/setuptools/_vendor/pyparsing/__pycache__/core.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
63
+ venv/Lib/site-packages/setuptools/cli-arm64.exe filter=lfs diff=lfs merge=lfs -text
64
+ venv/Lib/site-packages/setuptools/command/__pycache__/easy_install.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
65
+ venv/Lib/site-packages/setuptools/config/_validate_pyproject/__pycache__/fastjsonschema_validations.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
66
+ venv/Lib/site-packages/setuptools/gui-arm64.exe filter=lfs diff=lfs merge=lfs -text
67
+ venv/Lib/site-packages/winpty/winpty-agent.exe filter=lfs diff=lfs merge=lfs -text
68
+ venv/Lib/site-packages/winpty/winpty.cp311-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
69
+ venv/Lib/site-packages/winpty/winpty.dll filter=lfs diff=lfs merge=lfs -text
70
+ venv/Scripts/pip.exe filter=lfs diff=lfs merge=lfs -text
71
+ venv/Scripts/pip3.11.exe filter=lfs diff=lfs merge=lfs -text
72
+ venv/Scripts/pip3.exe filter=lfs diff=lfs merge=lfs -text
73
+ venv/Scripts/python.exe filter=lfs diff=lfs merge=lfs -text
74
+ venv/Scripts/pythonw.exe filter=lfs diff=lfs merge=lfs -text
.gitignore ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ venv
2
+ .vs
3
+ .vscode
4
+ models/*
5
+ !models/Readme.txt
6
+ uploaded_images/*
7
+ !uploaded_images/Readme.txt
8
+ uploaded_videos/*
9
+ !uploaded_videos/Readme.txt
10
+
Dockerfile ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #pull the nvidia cuda GPU docker image
2
+ FROM nvidia/cuda
3
+
4
+ #pull python 3.6.8 docker image
5
+ FROM python:3.6.8
6
+ ENV PYTHONDONTWRITEBYTECODE 1
7
+ ENV PYTHONUNBUFFERED 1
8
+ #create a directory to serve static files
9
+ RUN mkdir -p /home/app/staticfiles/app/uploaded_videos/
10
+ WORKDIR /app
11
+ COPY ./requirements.txt /app/requirements.txt
12
+ RUN python -m pip install --upgrade pip
13
+ RUN pip install cmake
14
+ RUN pip install opencv-python==4.2.0.32
15
+ RUN pip install -r requirements.txt
16
+ COPY . /app
17
+ RUN python manage.py collectstatic --noinput
18
+ RUN pip install gunicorn
19
+ RUN mkdir -p /app/uploaded_videos/app/uploaded_videos/
20
+
21
+ VOLUME /app/run/
22
+ ENTRYPOINT ["/app/bin/gunicorn_start.sh"]
README.md CHANGED
@@ -1,10 +1,83 @@
1
- ---
2
- title: Dep
3
- emoji: 🌍
4
- colorFrom: indigo
5
- colorTo: purple
6
- sdk: docker
7
- pinned: false
8
- ---
9
-
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Deep fake detection Django Application
2
+ ## Requirements:
3
+
4
+ **Note :** Nvidia GPU is mandatory to run the application.
5
+ - CUDA version >= 10.0 for GPU
6
+ - GPU Compute Capability > 3.0
7
+
8
+
9
+ You can find the list of requirements in [requirements.txt](https://github.com/abhijitjadhav1998/Deepfake_detection_using_deep_learning/blob/master/Django%20Application/requirements.txt). Main requirements are listed below:
10
+
11
+ ```
12
+ Python >= v3.6
13
+ Django >= v3.0
14
+ ```
15
+
16
+ ## Directory Structure
17
+
18
+ - ml_app -> Directory containing code in views.py file
19
+ - project_settings -> Contains Django settings and files to run in production
20
+ - static -> Contains all css, js and json files (for face-api)
21
+ - templates -> Template files for HTML
22
+
23
+ <b>Note:</b> Before running the project make sure you have created directories namely <strong>models, uploaded_images, uploaded_videos</strong> in the project root and that you have proper permissions to access them.
24
+ # Running application on Docker
25
+ #### Step 1: Install docker desktop and start the Docker daemon
26
+
27
+ #### Step 2: Run the deepfake detection docker docker image
28
+ ```
29
+ docker run --rm --gpus all -v static_volume:/home/app/staticfiles/ -v media_volume:/app/uploaded_videos/ --name=deepfakeapplication abhijitjadhav1998/deefake-detection-20framemodel
30
+ ```
31
+ #### Step 3: Run the Ngnix reverse proxy server docker image
32
+ ```
33
+ docker run -p 80:80 --volumes-from deepfakeapplication -v static_volume:/home/app/staticfiles/ -v media_volume:/app/uploaded_videos/ abhijitjadhav1998/deepfake-nginx-proxyserver
34
+ ```
35
+ #### Step 4: All set now launch up your application at [http://localhost:80](http://localhost:80)
36
+
37
+ ### Step 5: Star⭐ this repo 😉 on <a href="https://github.com/abhijitjadhav1998/Deepfake_detection_using_deep_learning" > <img src="https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white" /> </a> and Star⭐ this image on <a href="https://hub.docker.com/r/abhijitjadhav1998/deefake-detection-20framemodel"> <img src="https://img.shields.io/badge/Docker-2CA5E0?style=for-the-badge&logo=docker&logoColor=white" /> </a>
38
+
39
+ ## We deserve a Coffee ☕ <a href="https://www.buymeacoffee.com/abhijitjadhav" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 35px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>
40
+
41
+
42
+ Please note that currently we have only pushed the image of 20 Frames model, If you can to create your own image of other frames model follow the steps given in the [blog](https://abhijithjadhav.medium.com/dockerise-deepfake-detection-django-application-using-nvidia-cuda-40cdda3b6d38).
43
+
44
+ # Running application locally on your machine
45
+
46
+ ### Prerequisite
47
+ 1. Copy your trained model to the models folder.
48
+ - You can download our trained models from the [Google Drive](https://drive.google.com/drive/folders/1UX8jXUXyEjhLLZ38tcgOwGsZ6XFSLDJ-?usp=sharing) or you can train your models using the steps mentioned in Model Creation directory.
49
+
50
+ #### Step 1 : Clone the repo and Navigate to Django Application
51
+
52
+ `git clone https://github.com/abhijitjadhav1998/Deepfake_detection_using_deep_learning.git`
53
+
54
+ #### Step 2: Create virtualenv (optional)
55
+
56
+ `python -m venv venv`
57
+
58
+ #### Step 3: Activate virtualenv (optional)
59
+
60
+ `venv\Scripts\activate`
61
+
62
+ #### Step 4: Install requirements
63
+
64
+ `pip install -r requirements.txt`
65
+
66
+ #### Step 5: Copy Models
67
+
68
+ `Copy your trained model to the models folder i.e Django Application/models/`
69
+
70
+ - You can download our trained models from [Google Drive](https://drive.google.com/drive/folders/1UX8jXUXyEjhLLZ38tcgOwGsZ6XFSLDJ-?usp=sharing)
71
+
72
+ **Note :** The model name must be in specified format only i.e *model_84_acc_10_frames_final_data.pt*. Make sure that no of frames must be mentioned after certain 3 underscores `_` , in the above example the model is for 10 frames.
73
+
74
+
75
+ ### Step 6: Run project
76
+
77
+ `python manage.py runserver`
78
+
79
+ ## Demo
80
+ ### You can watch the [youtube video](https://www.youtube.com/watch?v=_q16aJTXVRE&t=823s) for demo
81
+ <p align="center">
82
+ <img src="https://github.com/abhijitjadhav1998/Deepfake_detection_using_deep_learning/blob/master/github_assets/fakegif.gif" />
83
+ </p>
bin/gunicorn_start.sh ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ NAME="project_settings" # Name of the application
4
+ DJANGODIR=/app # Django project directory
5
+ SOCKFILE=/app/run/gunicorn.sock # we will communicte using this unix socket
6
+ NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
7
+ DJANGO_SETTINGS_MODULE=project_settings.settings # which settings file should Django use
8
+ DJANGO_WSGI_MODULE=project_settings.wsgi # WSGI module name
9
+
10
+ echo "Starting $NAME as `whoami`"
11
+
12
+ # Create the run directory if it doesn't exist
13
+ RUNDIR=$(dirname $SOCKFILE)
14
+ test -d $RUNDIR || mkdir -p $RUNDIR
15
+
16
+ # Start your Django Gunicorn
17
+ gunicorn project_settings.wsgi:application --bind=unix:$SOCKFILE --workers $NUM_WORKERS --timeout 600
db.sqlite3 ADDED
Binary file (41 kB). View file
 
manage.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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', 'project_settings.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()
ml_app/__init__.py ADDED
File without changes
ml_app/__pycache__/__init__.cpython-36.pyc ADDED
Binary file (162 Bytes). View file
 
ml_app/__pycache__/__init__.cpython-38.pyc ADDED
Binary file (144 Bytes). View file
 
ml_app/__pycache__/apps.cpython-36.pyc ADDED
Binary file (377 Bytes). View file
 
ml_app/__pycache__/apps.cpython-38.pyc ADDED
Binary file (363 Bytes). View file
 
ml_app/__pycache__/forms.cpython-36.pyc ADDED
Binary file (581 Bytes). View file
 
ml_app/__pycache__/forms.cpython-38.pyc ADDED
Binary file (567 Bytes). View file
 
ml_app/__pycache__/models.cpython-36.pyc ADDED
Binary file (200 Bytes). View file
 
ml_app/__pycache__/models.cpython-38.pyc ADDED
Binary file (182 Bytes). View file
 
ml_app/__pycache__/urls.cpython-36.pyc ADDED
Binary file (616 Bytes). View file
 
ml_app/__pycache__/urls.cpython-38.pyc ADDED
Binary file (506 Bytes). View file
 
ml_app/__pycache__/views.cpython-36.pyc ADDED
Binary file (10.7 kB). View file
 
ml_app/__pycache__/views.cpython-38.pyc ADDED
Binary file (9.58 kB). View file
 
ml_app/admin.py ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ from django.contrib import admin
2
+
3
+ # Register your models here.
ml_app/apps.py ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ from django.apps import AppConfig
2
+
3
+
4
+ class MlAppConfig(AppConfig):
5
+ name = 'ml_app'
ml_app/forms.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ from django import forms
2
+
3
+ class VideoUploadForm(forms.Form):
4
+
5
+ upload_video_file = forms.FileField(label="Select Video", required=True,widget=forms.FileInput(attrs={"accept": "video/*"}))
6
+ sequence_length = forms.IntegerField(label="Sequence Length", required=True)
ml_app/models.py ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ from django.db import models
2
+
3
+ # Create your models here.
ml_app/templates/404.html ADDED
@@ -0,0 +1,422 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% extends 'base.html' %}
2
+ {%load static%}
3
+ {%block content%}
4
+ <style>
5
+ .main{
6
+ margin-top: 15%;
7
+ }
8
+
9
+ .st0{fill:#fff}
10
+ .st2{fill:#5d89af}
11
+ .st3{fill:#709abf}
12
+ .st4,.st6{
13
+ fill:#fff;
14
+ stroke:#b3dcdf;
15
+ stroke-miterlimit:10
16
+ }
17
+ .st6{
18
+ stroke:#5d89af;
19
+ stroke-width:2
20
+ }
21
+ .st7,.st8,.st9{
22
+ stroke:#709abf;
23
+ stroke-miterlimit:10
24
+ }
25
+
26
+ .st7{
27
+ stroke-width:5;
28
+ stroke-linecap:round;
29
+ fill:none
30
+ }
31
+ .st8,.st9{
32
+ fill:#fff
33
+ }
34
+ .st9{
35
+ fill:none
36
+ }
37
+ .st10{
38
+
39
+ }
40
+
41
+ #cloud1{
42
+ animation: cloud003 15s linear infinite;
43
+ }
44
+
45
+ #cloud2{
46
+ animation: cloud002 25s linear infinite;
47
+ }
48
+
49
+ #cloud3{
50
+ animation: cloud003 20s linear infinite;
51
+ }
52
+
53
+ #cloud4{
54
+ animation: float 4s linear infinite;
55
+ }
56
+
57
+ #cloud5{
58
+ animation: float 8s linear infinite;
59
+ }
60
+
61
+ #cloud7{
62
+ animation: float 5s linear infinite;
63
+ }
64
+
65
+ #tracks{
66
+ animation: slide 650ms linear infinite;
67
+ }
68
+
69
+ #bumps{
70
+ animation: land 10000ms linear infinite;
71
+ }
72
+
73
+ @keyframes jig {
74
+ 0% { transform: translateY(0px); }
75
+ 50% { transform: translateY(1px); }
76
+ 100% { transform: translateY(0px); }
77
+ }
78
+
79
+ #car-layers{
80
+ animation: jig 0.35s linear infinite;
81
+ }
82
+
83
+ @keyframes land {
84
+ from { transform: translateX(0); }
85
+ to { transform: translateX(1000px); }
86
+ }
87
+
88
+
89
+ @keyframes slide {
90
+ from { transform: translateX(0px); }
91
+ to { transform: translateX(100px); }
92
+ }
93
+
94
+ /* @keyframes cloudFloat {
95
+ 0% { transform: translateX(0) translateY(3px); }
96
+ 100% { transform: translateX(1000px) translateY(0); }
97
+ } */
98
+
99
+ @keyframes cloud001 {
100
+ 0% { transform: translateX(-1000px) translateY(3px); }
101
+ 100% { transform: translateX(1000px) translateY(0); }
102
+ }
103
+
104
+ @keyframes cloud002 {
105
+ 0% { transform: translateX(-1000px) translateY(3px); }
106
+ 100% { transform: translateX(1000px) translateY(0); }
107
+ }
108
+
109
+ @keyframes cloud003 {
110
+ 0% { transform: translateX(-1000px) translateY(3px); }
111
+ 100% { transform: translateX(1000px) translateY(0); }
112
+ }
113
+
114
+ @keyframes float {
115
+ 0% { transform: translateY(0px) translateX(0); }
116
+ 50% { transform: translateY(8px) translateX(5px); }
117
+ 100% { transform: translateY(0px) translateX(0); }
118
+ }
119
+
120
+ #bracefront, #braceback{
121
+ animation: braces 1s linear infinite;
122
+ }
123
+
124
+ @keyframes braces {
125
+ 0% { transform: translateX(-2px); }
126
+ 25% { transform: translateX(3px); }
127
+ 50% { transform: translateX(-2px); }
128
+ 75% { transform: translateX(3px); }
129
+ 100% { transform: translateX(-2px); }
130
+ }
131
+ </style>
132
+ <div class="main">
133
+ <div>
134
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 355">
135
+ <g id="ocean">
136
+ <path id="sky" class="st0" d="M0 0h1000v203.1H0z"/>
137
+ <linearGradient id="water_1_" gradientUnits="userSpaceOnUse" x1="500" y1="354" x2="500" y2="200.667">
138
+ <stop offset="0" stop-color="#fff"/>
139
+ <stop offset="1" stop-color="#b3dcdf"/>
140
+ </linearGradient>
141
+ <path id="water" fill="url(#water_1_)" d="M0 200.7h1000V354H0z"/>
142
+ <path id="land" class="st0" d="M0 273.4h1000V354H0z"/>
143
+ <g id="bumps">
144
+ <path class="st0" d="M0 275.2s83.8-28 180-28 197 28 197 28H0z"/>
145
+ <path class="st0" d="M377 275.2s54.7-28 117.5-28 128.6 28 128.6 28H377z"/>
146
+ <path class="st0" d="M623.2 275.2s83.7-28 179.9-28 196.9 28 196.9 28H623.2z"/>
147
+ <path class="st0" d="M-998 275.2s83.8-28 180-28 197 28 197 28h-377z"/>
148
+ <path class="st0" d="M-621 275.2s54.7-28 117.5-28 128.6 28 128.6 28H-621z"/>
149
+ <path class="st0" d="M-374.8 275.2s83.7-28 179.9-28S2 275.2 2 275.2h-376.8z"/>
150
+ </g>
151
+ </g>
152
+ <g id="tracks">
153
+ <path class="st2" d="M9.8 282.4h-3L0 307.6h3z"/>
154
+ <path class="st2" d="M19.8 282.4h-3L10 307.6h3z"/>
155
+ <path class="st2" d="M29.8 282.4h-3L20 307.6h3z"/>
156
+ <path class="st2" d="M39.8 282.4h-3L30 307.6h3z"/>
157
+ <path class="st2" d="M49.8 282.4h-3L40 307.6h3z"/>
158
+ <path class="st2" d="M59.8 282.4h-3L50 307.6h3z"/>
159
+ <path class="st2" d="M69.8 282.4h-3L60 307.6h3z"/>
160
+ <path class="st2" d="M79.8 282.4h-3L70 307.6h3z"/>
161
+ <path class="st2" d="M89.8 282.4h-3L80 307.6h3z"/>
162
+ <path class="st2" d="M99.8 282.4h-3L90 307.6h3z"/>
163
+ <path class="st2" d="M109.8 282.4h-3l-6.8 25.2h3z"/>
164
+ <path class="st2" d="M119.8 282.4h-3l-6.8 25.2h3z"/>
165
+ <path class="st2" d="M129.8 282.4h-3l-6.8 25.2h3z"/>
166
+ <path class="st2" d="M139.8 282.4h-3l-6.8 25.2h3z"/>
167
+ <path class="st2" d="M149.8 282.4h-3l-6.8 25.2h3z"/>
168
+ <path class="st2" d="M159.8 282.4h-3l-6.8 25.2h3z"/>
169
+ <path class="st2" d="M169.8 282.4h-3l-6.8 25.2h3z"/>
170
+ <path class="st2" d="M179.8 282.4h-3l-6.8 25.2h3z"/>
171
+ <path class="st2" d="M189.8 282.4h-3l-6.8 25.2h3z"/>
172
+ <path class="st2" d="M199.8 282.4h-3l-6.8 25.2h3z"/>
173
+ <path class="st2" d="M209.8 282.4h-3l-6.8 25.2h3z"/>
174
+ <path class="st2" d="M219.8 282.4h-3l-6.8 25.2h3z"/>
175
+ <path class="st2" d="M229.8 282.4h-3l-6.8 25.2h3z"/>
176
+ <path class="st2" d="M239.8 282.4h-3l-6.8 25.2h3z"/>
177
+ <path class="st2" d="M249.8 282.4h-3l-6.8 25.2h3z"/>
178
+ <path class="st2" d="M259.8 282.4h-3l-6.8 25.2h3z"/>
179
+ <path class="st2" d="M269.8 282.4h-3l-6.8 25.2h3z"/>
180
+ <path class="st2" d="M279.8 282.4h-3l-6.8 25.2h3z"/>
181
+ <path class="st2" d="M289.8 282.4h-3l-6.8 25.2h3z"/>
182
+ <path class="st2" d="M299.8 282.4h-3l-6.8 25.2h3z"/>
183
+ <path class="st2" d="M309.8 282.4h-3l-6.8 25.2h3z"/>
184
+ <path class="st2" d="M319.8 282.4h-3l-6.8 25.2h3z"/>
185
+ <path class="st2" d="M329.8 282.4h-3l-6.8 25.2h3z"/>
186
+ <path class="st2" d="M339.8 282.4h-3l-6.8 25.2h3z"/>
187
+ <path class="st2" d="M349.8 282.4h-3l-6.8 25.2h3z"/>
188
+ <path class="st2" d="M359.8 282.4h-3l-6.8 25.2h3z"/>
189
+ <path class="st2" d="M369.8 282.4h-3l-6.8 25.2h3z"/>
190
+ <path class="st2" d="M379.8 282.4h-3l-6.8 25.2h3z"/>
191
+ <path class="st2" d="M389.8 282.4h-3l-6.8 25.2h3z"/>
192
+ <path class="st2" d="M399.8 282.4h-3l-6.8 25.2h3z"/>
193
+ <path class="st2" d="M409.8 282.4h-3l-6.8 25.2h3z"/>
194
+ <path class="st2" d="M419.8 282.4h-3l-6.8 25.2h3z"/>
195
+ <path class="st2" d="M429.8 282.4h-3l-6.8 25.2h3z"/>
196
+ <path class="st2" d="M439.8 282.4h-3l-6.8 25.2h3z"/>
197
+ <path class="st2" d="M449.8 282.4h-3l-6.8 25.2h3z"/>
198
+ <path class="st2" d="M459.8 282.4h-3l-6.8 25.2h3z"/>
199
+ <path class="st2" d="M469.8 282.4h-3l-6.8 25.2h3z"/>
200
+ <path class="st2" d="M479.8 282.4h-3l-6.8 25.2h3z"/>
201
+ <path class="st2" d="M489.8 282.4h-3l-6.8 25.2h3z"/>
202
+ <path class="st2" d="M499.8 282.4h-3l-6.8 25.2h3z"/>
203
+ <path class="st2" d="M1000 282.4h-3l-6.8 25.2h3z"/>
204
+ <path class="st2" d="M990 282.4h-3l-6.8 25.2h3z"/>
205
+ <path class="st2" d="M980 282.4h-3l-6.8 25.2h3z"/>
206
+ <path class="st2" d="M970 282.4h-3l-6.8 25.2h3z"/>
207
+ <path class="st2" d="M960 282.4h-3l-6.8 25.2h3z"/>
208
+ <path class="st2" d="M950 282.4h-3l-6.8 25.2h3z"/>
209
+ <path class="st2" d="M940 282.4h-3l-6.8 25.2h3z"/>
210
+ <path class="st2" d="M930 282.4h-3l-6.8 25.2h3z"/>
211
+ <path class="st2" d="M920 282.4h-3l-6.8 25.2h3z"/>
212
+ <path class="st2" d="M910 282.4h-3l-6.8 25.2h3z"/>
213
+ <path class="st2" d="M900 282.4h-3l-6.8 25.2h3z"/>
214
+ <path class="st2" d="M890 282.4h-3l-6.8 25.2h3z"/>
215
+ <path class="st2" d="M880 282.4h-3l-6.8 25.2h3z"/>
216
+ <path class="st2" d="M870 282.4h-3l-6.8 25.2h3z"/>
217
+ <path class="st2" d="M860 282.4h-3l-6.8 25.2h3z"/>
218
+ <path class="st2" d="M850 282.4h-3l-6.8 25.2h3z"/>
219
+ <path class="st2" d="M840 282.4h-3l-6.8 25.2h3z"/>
220
+ <path class="st2" d="M830 282.4h-3l-6.8 25.2h3z"/>
221
+ <path class="st2" d="M820 282.4h-3l-6.8 25.2h3z"/>
222
+ <path class="st2" d="M810 282.4h-3l-6.8 25.2h3z"/>
223
+ <path class="st2" d="M800 282.4h-3l-6.8 25.2h3z"/>
224
+ <path class="st2" d="M790 282.4h-3l-6.8 25.2h3z"/>
225
+ <path class="st2" d="M780 282.4h-3l-6.8 25.2h3z"/>
226
+ <path class="st2" d="M770 282.4h-3l-6.8 25.2h3z"/>
227
+ <path class="st2" d="M760 282.4h-3l-6.8 25.2h3z"/>
228
+ <path class="st2" d="M750 282.4h-3l-6.8 25.2h3z"/>
229
+ <path class="st2" d="M740 282.4h-3l-6.8 25.2h3z"/>
230
+ <path class="st2" d="M730 282.4h-3l-6.8 25.2h3z"/>
231
+ <path class="st2" d="M720 282.4h-3l-6.8 25.2h3z"/>
232
+ <path class="st2" d="M710 282.4h-3l-6.8 25.2h3z"/>
233
+ <path class="st2" d="M700 282.4h-3l-6.8 25.2h3z"/>
234
+ <path class="st2" d="M690 282.4h-3l-6.8 25.2h3z"/>
235
+ <path class="st2" d="M680 282.4h-3l-6.8 25.2h3z"/>
236
+ <path class="st2" d="M670 282.4h-3l-6.8 25.2h3z"/>
237
+ <path class="st2" d="M660 282.4h-3l-6.8 25.2h3z"/>
238
+ <path class="st2" d="M650 282.4h-3l-6.8 25.2h3z"/>
239
+ <path class="st2" d="M640 282.4h-3l-6.8 25.2h3z"/>
240
+ <path class="st2" d="M630 282.4h-3l-6.8 25.2h3z"/>
241
+ <path class="st2" d="M620 282.4h-3l-6.8 25.2h3z"/>
242
+ <path class="st2" d="M610 282.4h-3l-6.8 25.2h3z"/>
243
+ <path class="st2" d="M600 282.4h-3l-6.8 25.2h3z"/>
244
+ <path class="st2" d="M590 282.4h-3l-6.8 25.2h3z"/>
245
+ <path class="st2" d="M580 282.4h-3l-6.8 25.2h3z"/>
246
+ <path class="st2" d="M570 282.4h-3l-6.8 25.2h3z"/>
247
+ <path class="st2" d="M560 282.4h-3l-6.8 25.2h3z"/>
248
+ <g>
249
+ <path class="st2" d="M-490.2 282.4h-3l-6.8 25.2h3z"/>
250
+ <path class="st2" d="M-480.2 282.4h-3l-6.8 25.2h3z"/>
251
+ <path class="st2" d="M-470.2 282.4h-3l-6.8 25.2h3z"/>
252
+ <path class="st2" d="M-460.2 282.4h-3l-6.8 25.2h3z"/>
253
+ <path class="st2" d="M-450.2 282.4h-3l-6.8 25.2h3z"/>
254
+ <path class="st2" d="M-440.2 282.4h-3l-6.8 25.2h3z"/>
255
+ <path class="st2" d="M-430.2 282.4h-3l-6.8 25.2h3z"/>
256
+ <path class="st2" d="M-420.2 282.4h-3l-6.8 25.2h3z"/>
257
+ <path class="st2" d="M-410.2 282.4h-3l-6.8 25.2h3z"/>
258
+ <path class="st2" d="M-400.2 282.4h-3l-6.8 25.2h3z"/>
259
+ <path class="st2" d="M-390.2 282.4h-3l-6.8 25.2h3z"/>
260
+ <path class="st2" d="M-380.2 282.4h-3l-6.8 25.2h3z"/>
261
+ <path class="st2" d="M-370.2 282.4h-3l-6.8 25.2h3z"/>
262
+ <path class="st2" d="M-360.2 282.4h-3l-6.8 25.2h3z"/>
263
+ <path class="st2" d="M-350.2 282.4h-3l-6.8 25.2h3z"/>
264
+ <path class="st2" d="M-340.2 282.4h-3l-6.8 25.2h3z"/>
265
+ <path class="st2" d="M-330.2 282.4h-3l-6.8 25.2h3z"/>
266
+ <path class="st2" d="M-320.2 282.4h-3l-6.8 25.2h3z"/>
267
+ <path class="st2" d="M-310.2 282.4h-3l-6.8 25.2h3z"/>
268
+ <path class="st2" d="M-300.2 282.4h-3l-6.8 25.2h3z"/>
269
+ <path class="st2" d="M-290.2 282.4h-3l-6.8 25.2h3z"/>
270
+ <path class="st2" d="M-280.2 282.4h-3l-6.8 25.2h3z"/>
271
+ <path class="st2" d="M-270.2 282.4h-3l-6.8 25.2h3z"/>
272
+ <path class="st2" d="M-260.2 282.4h-3l-6.8 25.2h3z"/>
273
+ <path class="st2" d="M-250.2 282.4h-3l-6.8 25.2h3z"/>
274
+ <path class="st2" d="M-240.2 282.4h-3l-6.8 25.2h3z"/>
275
+ <path class="st2" d="M-230.2 282.4h-3l-6.8 25.2h3z"/>
276
+ <path class="st2" d="M-220.2 282.4h-3l-6.8 25.2h3z"/>
277
+ <path class="st2" d="M-210.2 282.4h-3l-6.8 25.2h3z"/>
278
+ <path class="st2" d="M-200.2 282.4h-3l-6.8 25.2h3z"/>
279
+ <path class="st2" d="M-190.2 282.4h-3l-6.8 25.2h3z"/>
280
+ <path class="st2" d="M-180.2 282.4h-3l-6.8 25.2h3z"/>
281
+ <path class="st2" d="M-170.2 282.4h-3l-6.8 25.2h3z"/>
282
+ <path class="st2" d="M-160.2 282.4h-3l-6.8 25.2h3z"/>
283
+ <path class="st2" d="M-150.2 282.4h-3l-6.8 25.2h3z"/>
284
+ <path class="st2" d="M-140.2 282.4h-3l-6.8 25.2h3z"/>
285
+ <path class="st2" d="M-130.2 282.4h-3l-6.8 25.2h3z"/>
286
+ <path class="st2" d="M-120.2 282.4h-3l-6.8 25.2h3z"/>
287
+ <path class="st2" d="M-110.2 282.4h-3l-6.8 25.2h3z"/>
288
+ <path class="st2" d="M-100.2 282.4h-3l-6.8 25.2h3z"/>
289
+ <path class="st2" d="M-90.2 282.4h-3l-6.8 25.2h3z"/>
290
+ <path class="st2" d="M-80.2 282.4h-3l-6.8 25.2h3z"/>
291
+ <path class="st2" d="M-70.2 282.4h-3l-6.8 25.2h3z"/>
292
+ <path class="st2" d="M-60.2 282.4h-3l-6.8 25.2h3z"/>
293
+ <path class="st2" d="M-50.2 282.4h-3l-6.8 25.2h3z"/>
294
+ <path class="st2" d="M-40.2 282.4h-3l-6.8 25.2h3z"/>
295
+ <path class="st2" d="M-30.2 282.4h-3l-6.8 25.2h3z"/>
296
+ <path class="st2" d="M-20.2 282.4h-3l-6.8 25.2h3z"/>
297
+ <path class="st2" d="M-10.2 282.4h-3l-6.8 25.2h3z"/>
298
+ <path class="st2" d="M-.2 282.4h-3l-6.8 25.2h3z"/>
299
+ <path class="st2" d="M500 282.4h-3l-6.8 25.2h3z"/>
300
+ <path class="st2" d="M490 282.4h-3l-6.8 25.2h3z"/>
301
+ <path class="st2" d="M480 282.4h-3l-6.8 25.2h3z"/>
302
+ <path class="st2" d="M470 282.4h-3l-6.8 25.2h3z"/>
303
+ <path class="st2" d="M460 282.4h-3l-6.8 25.2h3z"/>
304
+ <path class="st2" d="M450 282.4h-3l-6.8 25.2h3z"/>
305
+ <path class="st2" d="M440 282.4h-3l-6.8 25.2h3z"/>
306
+ <path class="st2" d="M430 282.4h-3l-6.8 25.2h3z"/>
307
+ <path class="st2" d="M420 282.4h-3l-6.8 25.2h3z"/>
308
+ <path class="st2" d="M410 282.4h-3l-6.8 25.2h3z"/>
309
+ <path class="st2" d="M400 282.4h-3l-6.8 25.2h3z"/>
310
+ <path class="st2" d="M390 282.4h-3l-6.8 25.2h3z"/>
311
+ <path class="st2" d="M380 282.4h-3l-6.8 25.2h3z"/>
312
+ <path class="st2" d="M370 282.4h-3l-6.8 25.2h3z"/>
313
+ <path class="st2" d="M360 282.4h-3l-6.8 25.2h3z"/>
314
+ <path class="st2" d="M350 282.4h-3l-6.8 25.2h3z"/>
315
+ <path class="st2" d="M340 282.4h-3l-6.8 25.2h3z"/>
316
+ <path class="st2" d="M330 282.4h-3l-6.8 25.2h3z"/>
317
+ <path class="st2" d="M320 282.4h-3l-6.8 25.2h3z"/>
318
+ <path class="st2" d="M310 282.4h-3l-6.8 25.2h3z"/>
319
+ <path class="st2" d="M300 282.4h-3l-6.8 25.2h3z"/>
320
+ <path class="st2" d="M290 282.4h-3l-6.8 25.2h3z"/>
321
+ <path class="st2" d="M280 282.4h-3l-6.8 25.2h3z"/>
322
+ <path class="st2" d="M270 282.4h-3l-6.8 25.2h3z"/>
323
+ <path class="st2" d="M260 282.4h-3l-6.8 25.2h3z"/>
324
+ <path class="st2" d="M250 282.4h-3l-6.8 25.2h3z"/>
325
+ <path class="st2" d="M240 282.4h-3l-6.8 25.2h3z"/>
326
+ <path class="st2" d="M230 282.4h-3l-6.8 25.2h3z"/>
327
+ <path class="st2" d="M220 282.4h-3l-6.8 25.2h3z"/>
328
+ <path class="st2" d="M210 282.4h-3l-6.8 25.2h3z"/>
329
+ <path class="st2" d="M200 282.4h-3l-6.8 25.2h3z"/>
330
+ <path class="st2" d="M190 282.4h-3l-6.8 25.2h3z"/>
331
+ <path class="st2" d="M180 282.4h-3l-6.8 25.2h3z"/>
332
+ <path class="st2" d="M170 282.4h-3l-6.8 25.2h3z"/>
333
+ <path class="st2" d="M160 282.4h-3l-6.8 25.2h3z"/>
334
+ <path class="st2" d="M150 282.4h-3l-6.8 25.2h3z"/>
335
+ <path class="st2" d="M140 282.4h-3l-6.8 25.2h3z"/>
336
+ <path class="st2" d="M130 282.4h-3l-6.8 25.2h3z"/>
337
+ <path class="st2" d="M120 282.4h-3l-6.8 25.2h3z"/>
338
+ <path class="st2" d="M110 282.4h-3l-6.8 25.2h3z"/>
339
+ <path class="st2" d="M100 282.4h-3l-6.8 25.2h3z"/>
340
+ <path class="st2" d="M90 282.4h-3l-6.8 25.2h3z"/>
341
+ <path class="st2" d="M80 282.4h-3l-6.8 25.2h3z"/>
342
+ <path class="st2" d="M70 282.4h-3l-6.8 25.2h3z"/>
343
+ <path class="st2" d="M60 282.4h-3l-6.8 25.2h3z"/>
344
+ </g>
345
+ <path class="st2" d="M550 282.4h-3l-6.8 25.2h3z"/>
346
+ <path class="st2" d="M540 282.4h-3l-6.8 25.2h3z"/>
347
+ <path class="st2" d="M530 282.4h-3l-6.8 25.2h3z"/>
348
+ <path class="st2" d="M520 282.4h-3l-6.8 25.2h3z"/>
349
+ <path class="st2" d="M510 282.4h-3l-6.8 25.2h3z"/>
350
+ <path class="st2" d="M550 282.4h-3l-6.8 25.2h3z"/>
351
+ <path class="st2" d="M540 282.4h-3l-6.8 25.2h3z"/>
352
+ <path class="st2" d="M530 282.4h-3l-6.8 25.2h3z"/>
353
+ <path class="st2" d="M520 282.4h-3l-6.8 25.2h3z"/>
354
+ <path class="st2" d="M510 282.4h-3l-6.8 25.2h3z"/>
355
+ <path class="st3" d="M-499.5 300.2H1000v5.1H-499.5z"/>
356
+ <path class="st3" d="M-499.5 283.8H1000v2.8H-499.5z"/>
357
+ </g>
358
+ <g id="cloudsAll">
359
+ <path id="cloud1" class="st4" d="M19.5 69.7s-21.3.5-25-12.2c0 0-4.3-21.3 16-21.8 0 0-2.1-12.2 12.2-14.9 0 0 15-3.2 21.3 6.9 0 0 3.6-20.7 17.8-22.3 0 0 24-3 26.6 13.1 0 0 .1 9.5-2.8 13.5 0 0 9.5-15 26.5-4.8 0 0 12.1 7.9 7 20.2 0 0 16 4.8 10.1 18.1 0 0-10.2 8.5-17.1-1.1 0 0-5.5 16-32.5 16 0 0-19.1 2.1-27-13.3 0 0 .5 10.1-13.3 10.6-.1 0-20.3 3.2-19.8-8z"/>
360
+ <path id="cloud3" class="st4" d="M836 132s-18.3 2.1-22.2-4.9c0 0-4.9-11.8 12.5-13.8 0 0-2.5-6.8 9.7-9.6 0 0 12.7-3.1 18.7 2.1 0 0 2-12.2 14-14.3 0 0 16.6-3.3 23.7 2.1 0 0 4.8 3.9 2.4 6.5 0 0 3.1-4.8 18.4-.4 0 0 10.9 3.5 7.2 11 0 0 13.8-1.5 9.7 9.5 0 0-4.1 10.8-15.5 4.8 0 0-3.1 5.6-26.4 7.9 0 0-16.3 2.8-24-5.3 0 0 1 5.7-10.8 7.2-.1.1-17.2 3.6-17.4-2.8z"/>
361
+ <path id="cloud2" class="st4" d="M19.3 159.5s-15.9.6-18.8-5.1c0 0-3.4-9.5 11.7-10.1 0 0-1.7-5.5 9-6.9 0 0 11.2-1.7 16 2.8 0 0 2.5-9.4 13.1-10.3 0 0 17.9-1.8 20 5.4 0 0 .2 4.3-2 6.1 0 0 6.9-6.9 19.8-2.6 0 0 9.1 3.4 5.5 9 0 0 6.5 0 4.5 6.7 0 0-2.6 5.6-9.6 1 0 0-4 7.3-24.2 7.7 0 0-14.2 1.3-20.4-5.5 0 0 .5 4.5-9.8 5 0 .1-15 1.8-14.8-3.2z"/>
362
+ <path id="cloud4" class="st4" d="M370.3 109.5s15.9.6 18.8-5.1c0 0 3.4-9.5-11.7-10.1 0 0 1.7-5.5-9-6.9 0 0-11.2-1.7-16 2.8 0 0-2.5-9.4-13.1-10.3 0 0-17.9-1.8-20 5.4 0 0-.2 4.3 2 6.1 0 0-6.9-6.9-19.8-2.6 0 0-9.1 3.4-5.5 9 0 0-12 1.9-7.7 8 0 0 7.5 4 12.8-.2 0 0 4 7.3 24.2 7.7 0 0 14.2 1.3 20.4-5.5 0 0-.5 4.5 9.8 5 0 0 15.1 1.7 14.8-3.3z"/>
363
+ <path id="cloud5" class="st4" d="M511.7 12.4s-21.3-.3-25 7c0 0-4.3 12.2 16 12.5 0 0-2.1 7 12.2 8.6 0 0 15 1.8 21.3-4 0 0 3.6 11.9 17.8 12.8 0 0 19.5 1.6 27-4.4 0 0 5-4.4 2.1-6.7 0 0 4.1 4.4 21.2-1.5 0 0 12.1-4.6 7-11.6 0 0 16-2.8 10.1-10.4 0 0-10.2-4.9-17.1.6 0 0-5.5-9.2-32.5-9.2 0 0-19.1-1.2-27 7.6 0 0 .5-5.8-13.3-6.1-.1.2-20.3-1.6-19.8 4.8z"/>
364
+ </g>
365
+ <g id="train">
366
+ <path fill="#b3dcdf" d="M344.5 248.5h507.2v37.8H344.5z"/>
367
+ <g id="wheels">
368
+ <circle class="st6" cx="384.1" cy="285.6" r="15.1"/>
369
+ <path class="st2" d="M384.1 295.7c-5.6 0-10.1-4.5-10.1-10.1s4.5-10.1 10.1-10.1 10.1 4.5 10.1 10.1c0 5.5-4.6 10.1-10.1 10.1z"/>
370
+ <circle class="st6" cx="416.1" cy="285.6" r="15.1"/>
371
+ <path class="st2" d="M416.1 295.7c-5.6 0-10.1-4.5-10.1-10.1s4.5-10.1 10.1-10.1 10.1 4.5 10.1 10.1c0 5.5-4.6 10.1-10.1 10.1z"/>
372
+ <circle class="st6" cx="469.1" cy="285.6" r="15.1"/>
373
+ <path class="st2" d="M469.1 295.7c-5.6 0-10.1-4.5-10.1-10.1s4.5-10.1 10.1-10.1 10.1 4.5 10.1 10.1c0 5.5-4.6 10.1-10.1 10.1z"/>
374
+ <circle class="st6" cx="734.1" cy="285.6" r="15.1"/>
375
+ <path class="st2" d="M734.1 295.7c-5.6 0-10.1-4.5-10.1-10.1s4.5-10.1 10.1-10.1 10.1 4.5 10.1 10.1c0 5.5-4.6 10.1-10.1 10.1z"/>
376
+ <circle class="st6" cx="766.1" cy="285.6" r="15.1"/>
377
+ <path class="st2" d="M766.1 295.7c-5.6 0-10.1-4.5-10.1-10.1s4.5-10.1 10.1-10.1 10.1 4.5 10.1 10.1c0 5.5-4.6 10.1-10.1 10.1z"/>
378
+ <circle class="st6" cx="821.1" cy="285.6" r="15.1"/>
379
+ <path class="st2" d="M821.1 295.7c-5.6 0-10.1-4.5-10.1-10.1s4.5-10.1 10.1-10.1 10.1 4.5 10.1 10.1c0 5.5-4.6 10.1-10.1 10.1z"/>
380
+ </g>
381
+ <path id="bracefront" class="st7" d="M383.2 285.6h88.1"/>
382
+ <path id="braceback" class="st7" d="M733.2 285.6h88.1"/>
383
+ <g id="car-layers">
384
+ <path id="car" class="st8" d="M321.8 300.7v-32.4s1.2.7-1.5-2.4v-29.1s3.1-11.6 10.7-21.1c0 0 7.6-12 15.5-17.5h1.3s10.2-4.9 30.9-28h.6s-.9-1.4 0-2.7c0 0 10.1-10.5 21-12.3 0 0 9.4-1.8 20.2-1.8h47.7V151H492v-1.1h10.1v1.1h19v2.2s8.2.9 19.2-4.2c0 0 1.4-1.1 28.8-1.1h291.5v6.8h7.5v2.2s12.2-.6 12.2 9.8V177l-10-.1v57.9s14.9-.5 14.9 10.2c0 0 1 9-14.9 8.9v3.8H719.5s-2.4.1-4.3 3l-15 29s-2.9 5.1-10.8 5.1H504.3s-2.9.1-6.1-5l-13.1-25s-4.5-7.1-11.8-7.1H369v2.4s-3.2 1.3-7.1 8.7L351.4 289s-2.9 6.3-6.9 6.4h-17.8l-4.9 5.3z"/>
385
+ <path id="streamline-outine" class="st8" d="M320.3 236.6s1.4-6.8 4.4-11.3c0 0 .1-2.3 23.2-6.3l78-16.6s103.3-21.1 134.9-26.1c0 0 93.3-16 120.5-17.9 0 0 57.6-4.3 100-4.1h88.9v63.4s-10.3 5.4-17.1 5.3c0 0-305.6 4.9-366.3 8.1 0 0-100.3 4.8-119.1 6.8 0-.1-46.6 1.2-47.4-1.3z"/>
386
+ <g id="window-grate">
387
+ <path class="st9" d="M739.5 182.6H854"/>
388
+ <path class="st9" d="M739.5 177.6H854"/>
389
+ <path class="st9" d="M739.5 172.6H854"/>
390
+ <path class="st9" d="M739.5 167.6H854"/>
391
+ <path class="st9" d="M739.5 161.4H854v26.1H739.5z"/>
392
+ </g>
393
+ <path class="st9" d="M320.3 257.8h549.9"/>
394
+ <g id="Text">
395
+ <text transform="translate(377.037 230.025)" class="st8 st10" font-size="21">
396
+ 404
397
+ </text>
398
+ <text transform="translate(659.5 213.994)" class="st8 st10" font-size="24.025">
399
+ Page not found.
400
+ </text>
401
+ </g>
402
+ <g id="ladders">
403
+ <g id="ladder-f">
404
+ <path id="front-ladder" class="st8" d="M433.8 258.4h17.8v34.8h-17.8z"/>
405
+ <path id="fb-rung" class="st9" d="M433.8 281.1h17.7"/>
406
+ <path id="ft-rung" class="st9" d="M433.8 268.6h17.7"/>
407
+ </g>
408
+ <g id="ladder-b">
409
+ <path id="ladder-back" class="st8" d="M851.8 257.8h17.8v34.8h-17.8z"/>
410
+ <path id="bt-rung" class="st9" d="M851.8 268.6h17.7"/>
411
+ <path id="bb-rung" class="st9" d="M851.8 281.1h17.7"/>
412
+ </g>
413
+ </g>
414
+ <path id="window-front" class="st8" d="M350.5 196.4s-.4 3.9 15.2 4.3l32.3-30.3s-18.2 1.1-19-.8l-28.5 26.8z"/>
415
+ </g>
416
+ </g>
417
+ </svg>
418
+ </div>
419
+ </div>
420
+
421
+
422
+ {%endblock%}
ml_app/templates/about.html ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {% extends 'base.html' %}
2
+ {% load static %}
3
+ {%block content%}
4
+ {%endblock%}
ml_app/templates/cuda_full.html ADDED
@@ -0,0 +1,422 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% extends 'base.html' %}
2
+ {%load static%}
3
+ {%block content%}
4
+ <style>
5
+ .main{
6
+ margin-top: 15%;
7
+ }
8
+
9
+ .st0{fill:#fff}
10
+ .st2{fill:#5d89af}
11
+ .st3{fill:#709abf}
12
+ .st4,.st6{
13
+ fill:#fff;
14
+ stroke:#b3dcdf;
15
+ stroke-miterlimit:10
16
+ }
17
+ .st6{
18
+ stroke:#5d89af;
19
+ stroke-width:2
20
+ }
21
+ .st7,.st8,.st9{
22
+ stroke:#709abf;
23
+ stroke-miterlimit:10
24
+ }
25
+
26
+ .st7{
27
+ stroke-width:5;
28
+ stroke-linecap:round;
29
+ fill:none
30
+ }
31
+ .st8,.st9{
32
+ fill:#fff
33
+ }
34
+ .st9{
35
+ fill:none
36
+ }
37
+ .st10{
38
+
39
+ }
40
+
41
+ #cloud1{
42
+ animation: cloud003 15s linear infinite;
43
+ }
44
+
45
+ #cloud2{
46
+ animation: cloud002 25s linear infinite;
47
+ }
48
+
49
+ #cloud3{
50
+ animation: cloud003 20s linear infinite;
51
+ }
52
+
53
+ #cloud4{
54
+ animation: float 4s linear infinite;
55
+ }
56
+
57
+ #cloud5{
58
+ animation: float 8s linear infinite;
59
+ }
60
+
61
+ #cloud7{
62
+ animation: float 5s linear infinite;
63
+ }
64
+
65
+ #tracks{
66
+ animation: slide 650ms linear infinite;
67
+ }
68
+
69
+ #bumps{
70
+ animation: land 10000ms linear infinite;
71
+ }
72
+
73
+ @keyframes jig {
74
+ 0% { transform: translateY(0px); }
75
+ 50% { transform: translateY(1px); }
76
+ 100% { transform: translateY(0px); }
77
+ }
78
+
79
+ #car-layers{
80
+ animation: jig 0.35s linear infinite;
81
+ }
82
+
83
+ @keyframes land {
84
+ from { transform: translateX(0); }
85
+ to { transform: translateX(1000px); }
86
+ }
87
+
88
+
89
+ @keyframes slide {
90
+ from { transform: translateX(0px); }
91
+ to { transform: translateX(100px); }
92
+ }
93
+
94
+ /* @keyframes cloudFloat {
95
+ 0% { transform: translateX(0) translateY(3px); }
96
+ 100% { transform: translateX(1000px) translateY(0); }
97
+ } */
98
+
99
+ @keyframes cloud001 {
100
+ 0% { transform: translateX(-1000px) translateY(3px); }
101
+ 100% { transform: translateX(1000px) translateY(0); }
102
+ }
103
+
104
+ @keyframes cloud002 {
105
+ 0% { transform: translateX(-1000px) translateY(3px); }
106
+ 100% { transform: translateX(1000px) translateY(0); }
107
+ }
108
+
109
+ @keyframes cloud003 {
110
+ 0% { transform: translateX(-1000px) translateY(3px); }
111
+ 100% { transform: translateX(1000px) translateY(0); }
112
+ }
113
+
114
+ @keyframes float {
115
+ 0% { transform: translateY(0px) translateX(0); }
116
+ 50% { transform: translateY(8px) translateX(5px); }
117
+ 100% { transform: translateY(0px) translateX(0); }
118
+ }
119
+
120
+ #bracefront, #braceback{
121
+ animation: braces 1s linear infinite;
122
+ }
123
+
124
+ @keyframes braces {
125
+ 0% { transform: translateX(-2px); }
126
+ 25% { transform: translateX(3px); }
127
+ 50% { transform: translateX(-2px); }
128
+ 75% { transform: translateX(3px); }
129
+ 100% { transform: translateX(-2px); }
130
+ }
131
+ </style>
132
+ <div class="main">
133
+ <div>
134
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 355">
135
+ <g id="ocean">
136
+ <path id="sky" class="st0" d="M0 0h1000v203.1H0z"/>
137
+ <linearGradient id="water_1_" gradientUnits="userSpaceOnUse" x1="500" y1="354" x2="500" y2="200.667">
138
+ <stop offset="0" stop-color="#fff"/>
139
+ <stop offset="1" stop-color="#b3dcdf"/>
140
+ </linearGradient>
141
+ <path id="water" fill="url(#water_1_)" d="M0 200.7h1000V354H0z"/>
142
+ <path id="land" class="st0" d="M0 273.4h1000V354H0z"/>
143
+ <g id="bumps">
144
+ <path class="st0" d="M0 275.2s83.8-28 180-28 197 28 197 28H0z"/>
145
+ <path class="st0" d="M377 275.2s54.7-28 117.5-28 128.6 28 128.6 28H377z"/>
146
+ <path class="st0" d="M623.2 275.2s83.7-28 179.9-28 196.9 28 196.9 28H623.2z"/>
147
+ <path class="st0" d="M-998 275.2s83.8-28 180-28 197 28 197 28h-377z"/>
148
+ <path class="st0" d="M-621 275.2s54.7-28 117.5-28 128.6 28 128.6 28H-621z"/>
149
+ <path class="st0" d="M-374.8 275.2s83.7-28 179.9-28S2 275.2 2 275.2h-376.8z"/>
150
+ </g>
151
+ </g>
152
+ <g id="tracks">
153
+ <path class="st2" d="M9.8 282.4h-3L0 307.6h3z"/>
154
+ <path class="st2" d="M19.8 282.4h-3L10 307.6h3z"/>
155
+ <path class="st2" d="M29.8 282.4h-3L20 307.6h3z"/>
156
+ <path class="st2" d="M39.8 282.4h-3L30 307.6h3z"/>
157
+ <path class="st2" d="M49.8 282.4h-3L40 307.6h3z"/>
158
+ <path class="st2" d="M59.8 282.4h-3L50 307.6h3z"/>
159
+ <path class="st2" d="M69.8 282.4h-3L60 307.6h3z"/>
160
+ <path class="st2" d="M79.8 282.4h-3L70 307.6h3z"/>
161
+ <path class="st2" d="M89.8 282.4h-3L80 307.6h3z"/>
162
+ <path class="st2" d="M99.8 282.4h-3L90 307.6h3z"/>
163
+ <path class="st2" d="M109.8 282.4h-3l-6.8 25.2h3z"/>
164
+ <path class="st2" d="M119.8 282.4h-3l-6.8 25.2h3z"/>
165
+ <path class="st2" d="M129.8 282.4h-3l-6.8 25.2h3z"/>
166
+ <path class="st2" d="M139.8 282.4h-3l-6.8 25.2h3z"/>
167
+ <path class="st2" d="M149.8 282.4h-3l-6.8 25.2h3z"/>
168
+ <path class="st2" d="M159.8 282.4h-3l-6.8 25.2h3z"/>
169
+ <path class="st2" d="M169.8 282.4h-3l-6.8 25.2h3z"/>
170
+ <path class="st2" d="M179.8 282.4h-3l-6.8 25.2h3z"/>
171
+ <path class="st2" d="M189.8 282.4h-3l-6.8 25.2h3z"/>
172
+ <path class="st2" d="M199.8 282.4h-3l-6.8 25.2h3z"/>
173
+ <path class="st2" d="M209.8 282.4h-3l-6.8 25.2h3z"/>
174
+ <path class="st2" d="M219.8 282.4h-3l-6.8 25.2h3z"/>
175
+ <path class="st2" d="M229.8 282.4h-3l-6.8 25.2h3z"/>
176
+ <path class="st2" d="M239.8 282.4h-3l-6.8 25.2h3z"/>
177
+ <path class="st2" d="M249.8 282.4h-3l-6.8 25.2h3z"/>
178
+ <path class="st2" d="M259.8 282.4h-3l-6.8 25.2h3z"/>
179
+ <path class="st2" d="M269.8 282.4h-3l-6.8 25.2h3z"/>
180
+ <path class="st2" d="M279.8 282.4h-3l-6.8 25.2h3z"/>
181
+ <path class="st2" d="M289.8 282.4h-3l-6.8 25.2h3z"/>
182
+ <path class="st2" d="M299.8 282.4h-3l-6.8 25.2h3z"/>
183
+ <path class="st2" d="M309.8 282.4h-3l-6.8 25.2h3z"/>
184
+ <path class="st2" d="M319.8 282.4h-3l-6.8 25.2h3z"/>
185
+ <path class="st2" d="M329.8 282.4h-3l-6.8 25.2h3z"/>
186
+ <path class="st2" d="M339.8 282.4h-3l-6.8 25.2h3z"/>
187
+ <path class="st2" d="M349.8 282.4h-3l-6.8 25.2h3z"/>
188
+ <path class="st2" d="M359.8 282.4h-3l-6.8 25.2h3z"/>
189
+ <path class="st2" d="M369.8 282.4h-3l-6.8 25.2h3z"/>
190
+ <path class="st2" d="M379.8 282.4h-3l-6.8 25.2h3z"/>
191
+ <path class="st2" d="M389.8 282.4h-3l-6.8 25.2h3z"/>
192
+ <path class="st2" d="M399.8 282.4h-3l-6.8 25.2h3z"/>
193
+ <path class="st2" d="M409.8 282.4h-3l-6.8 25.2h3z"/>
194
+ <path class="st2" d="M419.8 282.4h-3l-6.8 25.2h3z"/>
195
+ <path class="st2" d="M429.8 282.4h-3l-6.8 25.2h3z"/>
196
+ <path class="st2" d="M439.8 282.4h-3l-6.8 25.2h3z"/>
197
+ <path class="st2" d="M449.8 282.4h-3l-6.8 25.2h3z"/>
198
+ <path class="st2" d="M459.8 282.4h-3l-6.8 25.2h3z"/>
199
+ <path class="st2" d="M469.8 282.4h-3l-6.8 25.2h3z"/>
200
+ <path class="st2" d="M479.8 282.4h-3l-6.8 25.2h3z"/>
201
+ <path class="st2" d="M489.8 282.4h-3l-6.8 25.2h3z"/>
202
+ <path class="st2" d="M499.8 282.4h-3l-6.8 25.2h3z"/>
203
+ <path class="st2" d="M1000 282.4h-3l-6.8 25.2h3z"/>
204
+ <path class="st2" d="M990 282.4h-3l-6.8 25.2h3z"/>
205
+ <path class="st2" d="M980 282.4h-3l-6.8 25.2h3z"/>
206
+ <path class="st2" d="M970 282.4h-3l-6.8 25.2h3z"/>
207
+ <path class="st2" d="M960 282.4h-3l-6.8 25.2h3z"/>
208
+ <path class="st2" d="M950 282.4h-3l-6.8 25.2h3z"/>
209
+ <path class="st2" d="M940 282.4h-3l-6.8 25.2h3z"/>
210
+ <path class="st2" d="M930 282.4h-3l-6.8 25.2h3z"/>
211
+ <path class="st2" d="M920 282.4h-3l-6.8 25.2h3z"/>
212
+ <path class="st2" d="M910 282.4h-3l-6.8 25.2h3z"/>
213
+ <path class="st2" d="M900 282.4h-3l-6.8 25.2h3z"/>
214
+ <path class="st2" d="M890 282.4h-3l-6.8 25.2h3z"/>
215
+ <path class="st2" d="M880 282.4h-3l-6.8 25.2h3z"/>
216
+ <path class="st2" d="M870 282.4h-3l-6.8 25.2h3z"/>
217
+ <path class="st2" d="M860 282.4h-3l-6.8 25.2h3z"/>
218
+ <path class="st2" d="M850 282.4h-3l-6.8 25.2h3z"/>
219
+ <path class="st2" d="M840 282.4h-3l-6.8 25.2h3z"/>
220
+ <path class="st2" d="M830 282.4h-3l-6.8 25.2h3z"/>
221
+ <path class="st2" d="M820 282.4h-3l-6.8 25.2h3z"/>
222
+ <path class="st2" d="M810 282.4h-3l-6.8 25.2h3z"/>
223
+ <path class="st2" d="M800 282.4h-3l-6.8 25.2h3z"/>
224
+ <path class="st2" d="M790 282.4h-3l-6.8 25.2h3z"/>
225
+ <path class="st2" d="M780 282.4h-3l-6.8 25.2h3z"/>
226
+ <path class="st2" d="M770 282.4h-3l-6.8 25.2h3z"/>
227
+ <path class="st2" d="M760 282.4h-3l-6.8 25.2h3z"/>
228
+ <path class="st2" d="M750 282.4h-3l-6.8 25.2h3z"/>
229
+ <path class="st2" d="M740 282.4h-3l-6.8 25.2h3z"/>
230
+ <path class="st2" d="M730 282.4h-3l-6.8 25.2h3z"/>
231
+ <path class="st2" d="M720 282.4h-3l-6.8 25.2h3z"/>
232
+ <path class="st2" d="M710 282.4h-3l-6.8 25.2h3z"/>
233
+ <path class="st2" d="M700 282.4h-3l-6.8 25.2h3z"/>
234
+ <path class="st2" d="M690 282.4h-3l-6.8 25.2h3z"/>
235
+ <path class="st2" d="M680 282.4h-3l-6.8 25.2h3z"/>
236
+ <path class="st2" d="M670 282.4h-3l-6.8 25.2h3z"/>
237
+ <path class="st2" d="M660 282.4h-3l-6.8 25.2h3z"/>
238
+ <path class="st2" d="M650 282.4h-3l-6.8 25.2h3z"/>
239
+ <path class="st2" d="M640 282.4h-3l-6.8 25.2h3z"/>
240
+ <path class="st2" d="M630 282.4h-3l-6.8 25.2h3z"/>
241
+ <path class="st2" d="M620 282.4h-3l-6.8 25.2h3z"/>
242
+ <path class="st2" d="M610 282.4h-3l-6.8 25.2h3z"/>
243
+ <path class="st2" d="M600 282.4h-3l-6.8 25.2h3z"/>
244
+ <path class="st2" d="M590 282.4h-3l-6.8 25.2h3z"/>
245
+ <path class="st2" d="M580 282.4h-3l-6.8 25.2h3z"/>
246
+ <path class="st2" d="M570 282.4h-3l-6.8 25.2h3z"/>
247
+ <path class="st2" d="M560 282.4h-3l-6.8 25.2h3z"/>
248
+ <g>
249
+ <path class="st2" d="M-490.2 282.4h-3l-6.8 25.2h3z"/>
250
+ <path class="st2" d="M-480.2 282.4h-3l-6.8 25.2h3z"/>
251
+ <path class="st2" d="M-470.2 282.4h-3l-6.8 25.2h3z"/>
252
+ <path class="st2" d="M-460.2 282.4h-3l-6.8 25.2h3z"/>
253
+ <path class="st2" d="M-450.2 282.4h-3l-6.8 25.2h3z"/>
254
+ <path class="st2" d="M-440.2 282.4h-3l-6.8 25.2h3z"/>
255
+ <path class="st2" d="M-430.2 282.4h-3l-6.8 25.2h3z"/>
256
+ <path class="st2" d="M-420.2 282.4h-3l-6.8 25.2h3z"/>
257
+ <path class="st2" d="M-410.2 282.4h-3l-6.8 25.2h3z"/>
258
+ <path class="st2" d="M-400.2 282.4h-3l-6.8 25.2h3z"/>
259
+ <path class="st2" d="M-390.2 282.4h-3l-6.8 25.2h3z"/>
260
+ <path class="st2" d="M-380.2 282.4h-3l-6.8 25.2h3z"/>
261
+ <path class="st2" d="M-370.2 282.4h-3l-6.8 25.2h3z"/>
262
+ <path class="st2" d="M-360.2 282.4h-3l-6.8 25.2h3z"/>
263
+ <path class="st2" d="M-350.2 282.4h-3l-6.8 25.2h3z"/>
264
+ <path class="st2" d="M-340.2 282.4h-3l-6.8 25.2h3z"/>
265
+ <path class="st2" d="M-330.2 282.4h-3l-6.8 25.2h3z"/>
266
+ <path class="st2" d="M-320.2 282.4h-3l-6.8 25.2h3z"/>
267
+ <path class="st2" d="M-310.2 282.4h-3l-6.8 25.2h3z"/>
268
+ <path class="st2" d="M-300.2 282.4h-3l-6.8 25.2h3z"/>
269
+ <path class="st2" d="M-290.2 282.4h-3l-6.8 25.2h3z"/>
270
+ <path class="st2" d="M-280.2 282.4h-3l-6.8 25.2h3z"/>
271
+ <path class="st2" d="M-270.2 282.4h-3l-6.8 25.2h3z"/>
272
+ <path class="st2" d="M-260.2 282.4h-3l-6.8 25.2h3z"/>
273
+ <path class="st2" d="M-250.2 282.4h-3l-6.8 25.2h3z"/>
274
+ <path class="st2" d="M-240.2 282.4h-3l-6.8 25.2h3z"/>
275
+ <path class="st2" d="M-230.2 282.4h-3l-6.8 25.2h3z"/>
276
+ <path class="st2" d="M-220.2 282.4h-3l-6.8 25.2h3z"/>
277
+ <path class="st2" d="M-210.2 282.4h-3l-6.8 25.2h3z"/>
278
+ <path class="st2" d="M-200.2 282.4h-3l-6.8 25.2h3z"/>
279
+ <path class="st2" d="M-190.2 282.4h-3l-6.8 25.2h3z"/>
280
+ <path class="st2" d="M-180.2 282.4h-3l-6.8 25.2h3z"/>
281
+ <path class="st2" d="M-170.2 282.4h-3l-6.8 25.2h3z"/>
282
+ <path class="st2" d="M-160.2 282.4h-3l-6.8 25.2h3z"/>
283
+ <path class="st2" d="M-150.2 282.4h-3l-6.8 25.2h3z"/>
284
+ <path class="st2" d="M-140.2 282.4h-3l-6.8 25.2h3z"/>
285
+ <path class="st2" d="M-130.2 282.4h-3l-6.8 25.2h3z"/>
286
+ <path class="st2" d="M-120.2 282.4h-3l-6.8 25.2h3z"/>
287
+ <path class="st2" d="M-110.2 282.4h-3l-6.8 25.2h3z"/>
288
+ <path class="st2" d="M-100.2 282.4h-3l-6.8 25.2h3z"/>
289
+ <path class="st2" d="M-90.2 282.4h-3l-6.8 25.2h3z"/>
290
+ <path class="st2" d="M-80.2 282.4h-3l-6.8 25.2h3z"/>
291
+ <path class="st2" d="M-70.2 282.4h-3l-6.8 25.2h3z"/>
292
+ <path class="st2" d="M-60.2 282.4h-3l-6.8 25.2h3z"/>
293
+ <path class="st2" d="M-50.2 282.4h-3l-6.8 25.2h3z"/>
294
+ <path class="st2" d="M-40.2 282.4h-3l-6.8 25.2h3z"/>
295
+ <path class="st2" d="M-30.2 282.4h-3l-6.8 25.2h3z"/>
296
+ <path class="st2" d="M-20.2 282.4h-3l-6.8 25.2h3z"/>
297
+ <path class="st2" d="M-10.2 282.4h-3l-6.8 25.2h3z"/>
298
+ <path class="st2" d="M-.2 282.4h-3l-6.8 25.2h3z"/>
299
+ <path class="st2" d="M500 282.4h-3l-6.8 25.2h3z"/>
300
+ <path class="st2" d="M490 282.4h-3l-6.8 25.2h3z"/>
301
+ <path class="st2" d="M480 282.4h-3l-6.8 25.2h3z"/>
302
+ <path class="st2" d="M470 282.4h-3l-6.8 25.2h3z"/>
303
+ <path class="st2" d="M460 282.4h-3l-6.8 25.2h3z"/>
304
+ <path class="st2" d="M450 282.4h-3l-6.8 25.2h3z"/>
305
+ <path class="st2" d="M440 282.4h-3l-6.8 25.2h3z"/>
306
+ <path class="st2" d="M430 282.4h-3l-6.8 25.2h3z"/>
307
+ <path class="st2" d="M420 282.4h-3l-6.8 25.2h3z"/>
308
+ <path class="st2" d="M410 282.4h-3l-6.8 25.2h3z"/>
309
+ <path class="st2" d="M400 282.4h-3l-6.8 25.2h3z"/>
310
+ <path class="st2" d="M390 282.4h-3l-6.8 25.2h3z"/>
311
+ <path class="st2" d="M380 282.4h-3l-6.8 25.2h3z"/>
312
+ <path class="st2" d="M370 282.4h-3l-6.8 25.2h3z"/>
313
+ <path class="st2" d="M360 282.4h-3l-6.8 25.2h3z"/>
314
+ <path class="st2" d="M350 282.4h-3l-6.8 25.2h3z"/>
315
+ <path class="st2" d="M340 282.4h-3l-6.8 25.2h3z"/>
316
+ <path class="st2" d="M330 282.4h-3l-6.8 25.2h3z"/>
317
+ <path class="st2" d="M320 282.4h-3l-6.8 25.2h3z"/>
318
+ <path class="st2" d="M310 282.4h-3l-6.8 25.2h3z"/>
319
+ <path class="st2" d="M300 282.4h-3l-6.8 25.2h3z"/>
320
+ <path class="st2" d="M290 282.4h-3l-6.8 25.2h3z"/>
321
+ <path class="st2" d="M280 282.4h-3l-6.8 25.2h3z"/>
322
+ <path class="st2" d="M270 282.4h-3l-6.8 25.2h3z"/>
323
+ <path class="st2" d="M260 282.4h-3l-6.8 25.2h3z"/>
324
+ <path class="st2" d="M250 282.4h-3l-6.8 25.2h3z"/>
325
+ <path class="st2" d="M240 282.4h-3l-6.8 25.2h3z"/>
326
+ <path class="st2" d="M230 282.4h-3l-6.8 25.2h3z"/>
327
+ <path class="st2" d="M220 282.4h-3l-6.8 25.2h3z"/>
328
+ <path class="st2" d="M210 282.4h-3l-6.8 25.2h3z"/>
329
+ <path class="st2" d="M200 282.4h-3l-6.8 25.2h3z"/>
330
+ <path class="st2" d="M190 282.4h-3l-6.8 25.2h3z"/>
331
+ <path class="st2" d="M180 282.4h-3l-6.8 25.2h3z"/>
332
+ <path class="st2" d="M170 282.4h-3l-6.8 25.2h3z"/>
333
+ <path class="st2" d="M160 282.4h-3l-6.8 25.2h3z"/>
334
+ <path class="st2" d="M150 282.4h-3l-6.8 25.2h3z"/>
335
+ <path class="st2" d="M140 282.4h-3l-6.8 25.2h3z"/>
336
+ <path class="st2" d="M130 282.4h-3l-6.8 25.2h3z"/>
337
+ <path class="st2" d="M120 282.4h-3l-6.8 25.2h3z"/>
338
+ <path class="st2" d="M110 282.4h-3l-6.8 25.2h3z"/>
339
+ <path class="st2" d="M100 282.4h-3l-6.8 25.2h3z"/>
340
+ <path class="st2" d="M90 282.4h-3l-6.8 25.2h3z"/>
341
+ <path class="st2" d="M80 282.4h-3l-6.8 25.2h3z"/>
342
+ <path class="st2" d="M70 282.4h-3l-6.8 25.2h3z"/>
343
+ <path class="st2" d="M60 282.4h-3l-6.8 25.2h3z"/>
344
+ </g>
345
+ <path class="st2" d="M550 282.4h-3l-6.8 25.2h3z"/>
346
+ <path class="st2" d="M540 282.4h-3l-6.8 25.2h3z"/>
347
+ <path class="st2" d="M530 282.4h-3l-6.8 25.2h3z"/>
348
+ <path class="st2" d="M520 282.4h-3l-6.8 25.2h3z"/>
349
+ <path class="st2" d="M510 282.4h-3l-6.8 25.2h3z"/>
350
+ <path class="st2" d="M550 282.4h-3l-6.8 25.2h3z"/>
351
+ <path class="st2" d="M540 282.4h-3l-6.8 25.2h3z"/>
352
+ <path class="st2" d="M530 282.4h-3l-6.8 25.2h3z"/>
353
+ <path class="st2" d="M520 282.4h-3l-6.8 25.2h3z"/>
354
+ <path class="st2" d="M510 282.4h-3l-6.8 25.2h3z"/>
355
+ <path class="st3" d="M-499.5 300.2H1000v5.1H-499.5z"/>
356
+ <path class="st3" d="M-499.5 283.8H1000v2.8H-499.5z"/>
357
+ </g>
358
+ <g id="cloudsAll">
359
+ <path id="cloud1" class="st4" d="M19.5 69.7s-21.3.5-25-12.2c0 0-4.3-21.3 16-21.8 0 0-2.1-12.2 12.2-14.9 0 0 15-3.2 21.3 6.9 0 0 3.6-20.7 17.8-22.3 0 0 24-3 26.6 13.1 0 0 .1 9.5-2.8 13.5 0 0 9.5-15 26.5-4.8 0 0 12.1 7.9 7 20.2 0 0 16 4.8 10.1 18.1 0 0-10.2 8.5-17.1-1.1 0 0-5.5 16-32.5 16 0 0-19.1 2.1-27-13.3 0 0 .5 10.1-13.3 10.6-.1 0-20.3 3.2-19.8-8z"/>
360
+ <path id="cloud3" class="st4" d="M836 132s-18.3 2.1-22.2-4.9c0 0-4.9-11.8 12.5-13.8 0 0-2.5-6.8 9.7-9.6 0 0 12.7-3.1 18.7 2.1 0 0 2-12.2 14-14.3 0 0 16.6-3.3 23.7 2.1 0 0 4.8 3.9 2.4 6.5 0 0 3.1-4.8 18.4-.4 0 0 10.9 3.5 7.2 11 0 0 13.8-1.5 9.7 9.5 0 0-4.1 10.8-15.5 4.8 0 0-3.1 5.6-26.4 7.9 0 0-16.3 2.8-24-5.3 0 0 1 5.7-10.8 7.2-.1.1-17.2 3.6-17.4-2.8z"/>
361
+ <path id="cloud2" class="st4" d="M19.3 159.5s-15.9.6-18.8-5.1c0 0-3.4-9.5 11.7-10.1 0 0-1.7-5.5 9-6.9 0 0 11.2-1.7 16 2.8 0 0 2.5-9.4 13.1-10.3 0 0 17.9-1.8 20 5.4 0 0 .2 4.3-2 6.1 0 0 6.9-6.9 19.8-2.6 0 0 9.1 3.4 5.5 9 0 0 6.5 0 4.5 6.7 0 0-2.6 5.6-9.6 1 0 0-4 7.3-24.2 7.7 0 0-14.2 1.3-20.4-5.5 0 0 .5 4.5-9.8 5 0 .1-15 1.8-14.8-3.2z"/>
362
+ <path id="cloud4" class="st4" d="M370.3 109.5s15.9.6 18.8-5.1c0 0 3.4-9.5-11.7-10.1 0 0 1.7-5.5-9-6.9 0 0-11.2-1.7-16 2.8 0 0-2.5-9.4-13.1-10.3 0 0-17.9-1.8-20 5.4 0 0-.2 4.3 2 6.1 0 0-6.9-6.9-19.8-2.6 0 0-9.1 3.4-5.5 9 0 0-12 1.9-7.7 8 0 0 7.5 4 12.8-.2 0 0 4 7.3 24.2 7.7 0 0 14.2 1.3 20.4-5.5 0 0-.5 4.5 9.8 5 0 0 15.1 1.7 14.8-3.3z"/>
363
+ <path id="cloud5" class="st4" d="M511.7 12.4s-21.3-.3-25 7c0 0-4.3 12.2 16 12.5 0 0-2.1 7 12.2 8.6 0 0 15 1.8 21.3-4 0 0 3.6 11.9 17.8 12.8 0 0 19.5 1.6 27-4.4 0 0 5-4.4 2.1-6.7 0 0 4.1 4.4 21.2-1.5 0 0 12.1-4.6 7-11.6 0 0 16-2.8 10.1-10.4 0 0-10.2-4.9-17.1.6 0 0-5.5-9.2-32.5-9.2 0 0-19.1-1.2-27 7.6 0 0 .5-5.8-13.3-6.1-.1.2-20.3-1.6-19.8 4.8z"/>
364
+ </g>
365
+ <g id="train">
366
+ <path fill="#b3dcdf" d="M344.5 248.5h507.2v37.8H344.5z"/>
367
+ <g id="wheels">
368
+ <circle class="st6" cx="384.1" cy="285.6" r="15.1"/>
369
+ <path class="st2" d="M384.1 295.7c-5.6 0-10.1-4.5-10.1-10.1s4.5-10.1 10.1-10.1 10.1 4.5 10.1 10.1c0 5.5-4.6 10.1-10.1 10.1z"/>
370
+ <circle class="st6" cx="416.1" cy="285.6" r="15.1"/>
371
+ <path class="st2" d="M416.1 295.7c-5.6 0-10.1-4.5-10.1-10.1s4.5-10.1 10.1-10.1 10.1 4.5 10.1 10.1c0 5.5-4.6 10.1-10.1 10.1z"/>
372
+ <circle class="st6" cx="469.1" cy="285.6" r="15.1"/>
373
+ <path class="st2" d="M469.1 295.7c-5.6 0-10.1-4.5-10.1-10.1s4.5-10.1 10.1-10.1 10.1 4.5 10.1 10.1c0 5.5-4.6 10.1-10.1 10.1z"/>
374
+ <circle class="st6" cx="734.1" cy="285.6" r="15.1"/>
375
+ <path class="st2" d="M734.1 295.7c-5.6 0-10.1-4.5-10.1-10.1s4.5-10.1 10.1-10.1 10.1 4.5 10.1 10.1c0 5.5-4.6 10.1-10.1 10.1z"/>
376
+ <circle class="st6" cx="766.1" cy="285.6" r="15.1"/>
377
+ <path class="st2" d="M766.1 295.7c-5.6 0-10.1-4.5-10.1-10.1s4.5-10.1 10.1-10.1 10.1 4.5 10.1 10.1c0 5.5-4.6 10.1-10.1 10.1z"/>
378
+ <circle class="st6" cx="821.1" cy="285.6" r="15.1"/>
379
+ <path class="st2" d="M821.1 295.7c-5.6 0-10.1-4.5-10.1-10.1s4.5-10.1 10.1-10.1 10.1 4.5 10.1 10.1c0 5.5-4.6 10.1-10.1 10.1z"/>
380
+ </g>
381
+ <path id="bracefront" class="st7" d="M383.2 285.6h88.1"/>
382
+ <path id="braceback" class="st7" d="M733.2 285.6h88.1"/>
383
+ <g id="car-layers">
384
+ <path id="car" class="st8" d="M321.8 300.7v-32.4s1.2.7-1.5-2.4v-29.1s3.1-11.6 10.7-21.1c0 0 7.6-12 15.5-17.5h1.3s10.2-4.9 30.9-28h.6s-.9-1.4 0-2.7c0 0 10.1-10.5 21-12.3 0 0 9.4-1.8 20.2-1.8h47.7V151H492v-1.1h10.1v1.1h19v2.2s8.2.9 19.2-4.2c0 0 1.4-1.1 28.8-1.1h291.5v6.8h7.5v2.2s12.2-.6 12.2 9.8V177l-10-.1v57.9s14.9-.5 14.9 10.2c0 0 1 9-14.9 8.9v3.8H719.5s-2.4.1-4.3 3l-15 29s-2.9 5.1-10.8 5.1H504.3s-2.9.1-6.1-5l-13.1-25s-4.5-7.1-11.8-7.1H369v2.4s-3.2 1.3-7.1 8.7L351.4 289s-2.9 6.3-6.9 6.4h-17.8l-4.9 5.3z"/>
385
+ <path id="streamline-outine" class="st8" d="M320.3 236.6s1.4-6.8 4.4-11.3c0 0 .1-2.3 23.2-6.3l78-16.6s103.3-21.1 134.9-26.1c0 0 93.3-16 120.5-17.9 0 0 57.6-4.3 100-4.1h88.9v63.4s-10.3 5.4-17.1 5.3c0 0-305.6 4.9-366.3 8.1 0 0-100.3 4.8-119.1 6.8 0-.1-46.6 1.2-47.4-1.3z"/>
386
+ <g id="window-grate">
387
+ <path class="st9" d="M739.5 182.6H854"/>
388
+ <path class="st9" d="M739.5 177.6H854"/>
389
+ <path class="st9" d="M739.5 172.6H854"/>
390
+ <path class="st9" d="M739.5 167.6H854"/>
391
+ <path class="st9" d="M739.5 161.4H854v26.1H739.5z"/>
392
+ </g>
393
+ <path class="st9" d="M320.3 257.8h549.9"/>
394
+ <g id="Text">
395
+ <text transform="translate(377.037 230.025)" class="st8 st10" font-size="21">
396
+ Server is out of GPU memory.
397
+ </text>
398
+ <text transform="translate(659.5 213.994)" class="st8 st10" font-size="24.025">
399
+ Please try again.
400
+ </text>
401
+ </g>
402
+ <g id="ladders">
403
+ <g id="ladder-f">
404
+ <path id="front-ladder" class="st8" d="M433.8 258.4h17.8v34.8h-17.8z"/>
405
+ <path id="fb-rung" class="st9" d="M433.8 281.1h17.7"/>
406
+ <path id="ft-rung" class="st9" d="M433.8 268.6h17.7"/>
407
+ </g>
408
+ <g id="ladder-b">
409
+ <path id="ladder-back" class="st8" d="M851.8 257.8h17.8v34.8h-17.8z"/>
410
+ <path id="bt-rung" class="st9" d="M851.8 268.6h17.7"/>
411
+ <path id="bb-rung" class="st9" d="M851.8 281.1h17.7"/>
412
+ </g>
413
+ </g>
414
+ <path id="window-front" class="st8" d="M350.5 196.4s-.4 3.9 15.2 4.3l32.3-30.3s-18.2 1.1-19-.8l-28.5 26.8z"/>
415
+ </g>
416
+ </g>
417
+ </svg>
418
+ </div>
419
+ </div>
420
+
421
+
422
+ {%endblock%}
ml_app/templates/index.html ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% extends 'base.html' %}
2
+ {%load static%}
3
+ {%block content%}
4
+ <div class="bg" >
5
+ <div class="container">
6
+
7
+ <div class="row align-items-center justify-content-center">
8
+ <div class="col-12 my-auto">
9
+ <div class="logo text-center mb-3"><img src="{% static 'images/logo1.png'%}" alt="Logo" ></div>
10
+ <div class="width-400">
11
+ <video width="100%" controls id="videos">
12
+ <source src="" id="video_source">
13
+ Your browser does not support HTML5 video.
14
+ </video>
15
+ <form class="form" method="POST" enctype="multipart/form-data" name="video-upload" id="video-upload"
16
+ class="text-center mt-3">
17
+ {%csrf_token%}
18
+ <div class="form-group">
19
+ <label>{{form.upload_video_file.widget}}</label>
20
+ {{form.upload_video_file}}
21
+ <!-- <input type="file" id="{{form.upload_video_file.id_for_label}}" name="{{form.upload_video_file.name}}" /> -->
22
+ {%if form.upload_video_file.errors%}
23
+ {%for each_error in form.upload_video_file.errors%}
24
+ <div class="alert alert-danger mt-1 {{form.upload_video_file.id_for_label}}">
25
+ {{each_error}}
26
+ </div>
27
+ {%endfor%}
28
+ {%endif%}
29
+ </div>
30
+ <div class="form-group">
31
+ <label for="{{form.sequence_length.id_for_label}}">{{form.sequence_length.label}}: </label><span
32
+ id="slider-value"></span>
33
+ <input type="number" hidden="hidden" id="{{form.sequence_length.id_for_label}}"
34
+ name="{{form.sequence_length.name}}"></input>
35
+ <div id='slider'></div>
36
+ {%if form.sequence_length.errors%}
37
+ {%for each_error in form.sequence_length.errors%}
38
+ <div class="alert alert-danger mt-1 {{form.sequence_length.id_for_label}}">
39
+ {{each_error}}
40
+ </div>
41
+ {%endfor%}
42
+ {%endif%}
43
+ </div>
44
+ <button id="videoUpload" type="submit" name="submit" class="btn btn-success mt-3 btn-block">Upload</button>
45
+ </form>
46
+ </div>
47
+ </div>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ {%endblock%}
52
+ {%block js_cripts%}
53
+ <script src="{%static 'js/script.js'%}"></script>
54
+ <script>
55
+ $(function () {
56
+ var sliderSequenceNumbers = [10,20,40,60,80,100];
57
+ var slider = $("div#slider").slider({
58
+ value: 1,
59
+ min: 0,
60
+ max: sliderSequenceNumbers.length-1,
61
+ slide: function (event, ui) {
62
+ $('#{{form.sequence_length.id_for_label}}').val(sliderSequenceNumbers[ui.value]);
63
+ $('#{{form.sequence_length.id_for_label}}').val(sliderSequenceNumbers[ui.value]);
64
+ $('#slider-value').html(sliderSequenceNumbers[ui.value]);
65
+ }
66
+ });
67
+ $("#{{form.sequence_length.id_for_label}}").val(sliderSequenceNumbers[$("#slider").slider("value")]);
68
+ $('#slider-value').html(sliderSequenceNumbers[$("#slider").slider("value")]);
69
+ });
70
+ </script>
71
+ {%endblock%}
ml_app/templates/predict.html ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% extends 'base.html' %}
2
+ {% load static %}
3
+ {%block content%}
4
+ {%if no_faces%}
5
+ <div class="container">
6
+ <div class="logo text-center mb-3"><img src="{% static 'images/logo1.png'%}" alt="Logo" ></div>
7
+ <hr />
8
+ <div class="alert alert-danger">
9
+ No faces detected. Cannot process the video.
10
+ </div>
11
+ </div>
12
+ {%else%}
13
+ <div class="container">
14
+ <div class="logo text-center mb-3"><img src="{% static 'images/logo1.png'%}" alt="Logo" ></div>
15
+ <hr />
16
+
17
+ <h3>Frames Split</h3>
18
+ <div id="preprocessed_images" class="col-12 mt-4 mb-2">
19
+ {% for each_image in preprocessed_images %}
20
+ <img src="{%static each_image%}" class="preprocess" width=auto height="250" />
21
+ {%endfor%}
22
+ </div>
23
+
24
+
25
+ <h3>Face Cropped Frames</h3>
26
+ <div id="faces_images" class="col-12 mb-2">
27
+ {% for each_image in faces_cropped_images %}
28
+ <img src="{%static each_image%}" class="faces" width=auto height="150" />
29
+ {%endfor%}
30
+ </div>
31
+
32
+ <div class="result text-center">
33
+ <h3>Play to see Result</h3>
34
+ <video height="320" width="640" id="predict-media" controls>
35
+ <source src="{{MEDIA_URL}}{{original_video}}" type="video/mp4" codecs="avc1.4d002a" />
36
+ </video>
37
+ {%if output == "REAL" %}
38
+ <h4 class="mx-auto">Result: <span style="color:green">{{output}}</span>
39
+ <img src="{% static 'images/thumpup.png'%}" alt="real" height="100px" width=auto>
40
+ {%else%}
41
+ <h4 class="mx-auto">Result: <span style="color:red">{{output}}</span>
42
+ <img src="{% static 'images/thumpdown.png'%}" alt="fake" height="100px" width=auto >
43
+ {%endif%}
44
+ </div>
45
+ <!--
46
+ <h3>Heat Maps</h3>
47
+ <div id="heatmap_images" class="col-12 mb-4 ">
48
+ {% for each_heatmap_image in heatmap_images %}
49
+ <img src="{%static each_heatmap_image%}" class="heat-map" width="100" height="150" />
50
+ {%endfor%}
51
+ </div>
52
+ </div>
53
+ -->
54
+ {%endif%}
55
+ {%endblock%}
56
+ {%block js_cripts%}
57
+ <script src="{%static 'js/face-api.min.js'%}"></script>
58
+ <script>
59
+ $(document).ready(function () {
60
+ const video = document.getElementById("predict-media");
61
+
62
+ Promise.all([
63
+ faceapi.nets.ssdMobilenetv1.loadFromUri('/static/json'),
64
+ faceapi.nets.tinyFaceDetector.loadFromUri("/static/json")
65
+
66
+ ])
67
+
68
+ var detectionTimeout;
69
+ video.addEventListener("playing", () => {
70
+ var canvas;
71
+ if ($('canvas').length < 1) {
72
+ canvas = faceapi.createCanvasFromMedia(video);
73
+ canvas.style.top = video.offsetTop + "px";
74
+ canvas.style.left = video.offsetLeft + "px";
75
+ document.body.append(canvas);
76
+ }
77
+ /* In order to be able to pause the video */
78
+ const displaySize = { width: video.width, height: video.height - 60 };
79
+ faceapi.matchDimensions(canvas, displaySize);
80
+
81
+ detectionTimeout = setInterval(async () => {
82
+ const detections = await faceapi.detectAllFaces(video);
83
+ const resizedDetections = faceapi.resizeResults(detections, displaySize);
84
+ canvas.getContext("2d").clearRect(0, 0, canvas.width, canvas.height);
85
+ canvas.style.top = video.offsetTop + "px";
86
+ canvas.style.left = video.offsetLeft + "px";
87
+ resizedDetections.forEach((result, i) => {
88
+ console.log(resizedDetections[i].box);
89
+ var result = '{{output}}';
90
+ var confidence = '{{confidence}}';
91
+ var drawOptions = {label: result.concat(" " , confidence , "%")};
92
+ if (result == 'REAL'){
93
+ drawOptions["boxColor"] = "#0f0";
94
+ }
95
+ else if (result == 'FAKE'){
96
+ drawOptions["boxColor"] = "#f00";
97
+ }
98
+ var box = { x: resizedDetections[i].box.x, y: resizedDetections[i].box.y, height: 100, width: 100 };
99
+ const drawBox = new faceapi.draw.DrawBox(box, drawOptions);
100
+ drawBox.draw(canvas);
101
+ });
102
+ }, 1);
103
+ });
104
+
105
+ video.addEventListener("paused", () => {
106
+ clearTimeout(detectionTimeout);
107
+ });
108
+ })
109
+ </script>
110
+ {%endblock%}
ml_app/tests.py ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ from django.test import TestCase
2
+
3
+ # Create your tests here.
ml_app/urls.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """project_settings URL Configuration
2
+ """
3
+ from django.contrib import admin
4
+ from django.urls import path, include
5
+ from . import views
6
+ from .views import about, index, predict_page,cuda_full
7
+
8
+ app_name = 'ml_app'
9
+ handler404 = views.handler404
10
+
11
+ urlpatterns = [
12
+ path('', index, name='home'),
13
+ path('about/', about, name='about'),
14
+ path('predict/', predict_page, name='predict'),
15
+ path('cuda_full/',cuda_full,name='cuda_full'),
16
+ ]
ml_app/views.py ADDED
@@ -0,0 +1,392 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from django.shortcuts import render, redirect
2
+ import torch
3
+ import torchvision
4
+ from torchvision import transforms, models
5
+ from torch.utils.data import DataLoader
6
+ from torch.utils.data.dataset import Dataset
7
+ import os
8
+ import numpy as np
9
+ import cv2
10
+ import matplotlib.pyplot as plt
11
+ import face_recognition
12
+ from torch.autograd import Variable
13
+ import time
14
+ import sys
15
+ from torch import nn
16
+ import json
17
+ import glob
18
+ import copy
19
+ from torchvision import models
20
+ import shutil
21
+ from PIL import Image as pImage
22
+ import time
23
+ from django.conf import settings
24
+ from .forms import VideoUploadForm
25
+
26
+ index_template_name = 'index.html'
27
+ predict_template_name = 'predict.html'
28
+ about_template_name = "about.html"
29
+
30
+ im_size = 112
31
+ mean=[0.485, 0.456, 0.406]
32
+ std=[0.229, 0.224, 0.225]
33
+ sm = nn.Softmax()
34
+ inv_normalize = transforms.Normalize(mean=-1*np.divide(mean,std),std=np.divide([1,1,1],std))
35
+ if torch.cuda.is_available():
36
+ device = 'gpu'
37
+ else:
38
+ device = 'cpu'
39
+
40
+ train_transforms = transforms.Compose([
41
+ transforms.ToPILImage(),
42
+ transforms.Resize((im_size,im_size)),
43
+ transforms.ToTensor(),
44
+ transforms.Normalize(mean,std)])
45
+
46
+ class Model(nn.Module):
47
+
48
+ def __init__(self, num_classes,latent_dim= 2048, lstm_layers=1 , hidden_dim = 2048, bidirectional = False):
49
+ super(Model, self).__init__()
50
+ model = models.resnext50_32x4d(pretrained = True)
51
+ self.model = nn.Sequential(*list(model.children())[:-2])
52
+ self.lstm = nn.LSTM(latent_dim,hidden_dim, lstm_layers, bidirectional)
53
+ self.relu = nn.LeakyReLU()
54
+ self.dp = nn.Dropout(0.4)
55
+ self.linear1 = nn.Linear(2048,num_classes)
56
+ self.avgpool = nn.AdaptiveAvgPool2d(1)
57
+
58
+ def forward(self, x):
59
+ batch_size,seq_length, c, h, w = x.shape
60
+ x = x.view(batch_size * seq_length, c, h, w)
61
+ fmap = self.model(x)
62
+ x = self.avgpool(fmap)
63
+ x = x.view(batch_size,seq_length,2048)
64
+ x_lstm,_ = self.lstm(x,None)
65
+ return fmap,self.dp(self.linear1(x_lstm[:,-1,:]))
66
+
67
+
68
+ class validation_dataset(Dataset):
69
+ def __init__(self,video_names,sequence_length=60,transform = None):
70
+ self.video_names = video_names
71
+ self.transform = transform
72
+ self.count = sequence_length
73
+
74
+ def __len__(self):
75
+ return len(self.video_names)
76
+
77
+ def __getitem__(self,idx):
78
+ video_path = self.video_names[idx]
79
+ frames = []
80
+ a = int(100/self.count)
81
+ first_frame = np.random.randint(0,a)
82
+ for i,frame in enumerate(self.frame_extract(video_path)):
83
+ #if(i % a == first_frame):
84
+ faces = face_recognition.face_locations(frame)
85
+ try:
86
+ top,right,bottom,left = faces[0]
87
+ frame = frame[top:bottom,left:right,:]
88
+ except:
89
+ pass
90
+ frames.append(self.transform(frame))
91
+ if(len(frames) == self.count):
92
+ break
93
+ """
94
+ for i,frame in enumerate(self.frame_extract(video_path)):
95
+ if(i % a == first_frame):
96
+ frames.append(self.transform(frame))
97
+ """
98
+ # if(len(frames)<self.count):
99
+ # for i in range(self.count-len(frames)):
100
+ # frames.append(self.transform(frame))
101
+ #print("no of frames", self.count)
102
+ frames = torch.stack(frames)
103
+ frames = frames[:self.count]
104
+ return frames.unsqueeze(0)
105
+
106
+ def frame_extract(self,path):
107
+ vidObj = cv2.VideoCapture(path)
108
+ success = 1
109
+ while success:
110
+ success, image = vidObj.read()
111
+ if success:
112
+ yield image
113
+
114
+ def im_convert(tensor, video_file_name):
115
+ """ Display a tensor as an image. """
116
+ image = tensor.to("cpu").clone().detach()
117
+ image = image.squeeze()
118
+ image = inv_normalize(image)
119
+ image = image.numpy()
120
+ image = image.transpose(1,2,0)
121
+ image = image.clip(0, 1)
122
+ # This image is not used
123
+ # cv2.imwrite(os.path.join(settings.PROJECT_DIR, 'uploaded_images', video_file_name+'_convert_2.png'),image*255)
124
+ return image
125
+
126
+ def im_plot(tensor):
127
+ image = tensor.cpu().numpy().transpose(1,2,0)
128
+ b,g,r = cv2.split(image)
129
+ image = cv2.merge((r,g,b))
130
+ image = image*[0.22803, 0.22145, 0.216989] + [0.43216, 0.394666, 0.37645]
131
+ image = image*255.0
132
+ plt.imshow(image.astype('uint8'))
133
+ plt.show()
134
+
135
+
136
+ def predict(model,img,path = './', video_file_name=""):
137
+ fmap,logits = model(img.to(device))
138
+ img = im_convert(img[:,-1,:,:,:], video_file_name)
139
+ params = list(model.parameters())
140
+ weight_softmax = model.linear1.weight.detach().cpu().numpy()
141
+ logits = sm(logits)
142
+ _,prediction = torch.max(logits,1)
143
+ confidence = logits[:,int(prediction.item())].item()*100
144
+ print('confidence of prediction:',logits[:,int(prediction.item())].item()*100)
145
+ return [int(prediction.item()),confidence]
146
+
147
+ def plot_heat_map(i, model, img, path = './', video_file_name=''):
148
+ fmap,logits = model(img.to(device))
149
+ params = list(model.parameters())
150
+ weight_softmax = model.linear1.weight.detach().cpu().numpy()
151
+ logits = sm(logits)
152
+ _,prediction = torch.max(logits,1)
153
+ idx = np.argmax(logits.detach().cpu().numpy())
154
+ bz, nc, h, w = fmap.shape
155
+ #out = np.dot(fmap[-1].detach().cpu().numpy().reshape((nc, h*w)).T,weight_softmax[idx,:].T)
156
+ out = np.dot(fmap[i].detach().cpu().numpy().reshape((nc, h*w)).T,weight_softmax[idx,:].T)
157
+ predict = out.reshape(h,w)
158
+ predict = predict - np.min(predict)
159
+ predict_img = predict / np.max(predict)
160
+ predict_img = np.uint8(255*predict_img)
161
+ out = cv2.resize(predict_img, (im_size,im_size))
162
+ heatmap = cv2.applyColorMap(out, cv2.COLORMAP_JET)
163
+ img = im_convert(img[:,-1,:,:,:], video_file_name)
164
+ result = heatmap * 0.5 + img*0.8*255
165
+ # Saving heatmap - Start
166
+ heatmap_name = video_file_name+"_heatmap_"+str(i)+".png"
167
+ image_name = os.path.join(settings.PROJECT_DIR, 'uploaded_images', heatmap_name)
168
+ cv2.imwrite(image_name,result)
169
+ # Saving heatmap - End
170
+ result1 = heatmap * 0.5/255 + img*0.8
171
+ r,g,b = cv2.split(result1)
172
+ result1 = cv2.merge((r,g,b))
173
+ return image_name
174
+
175
+ # Model Selection
176
+ def get_accurate_model(sequence_length):
177
+ model_name = []
178
+ sequence_model = []
179
+ final_model = ""
180
+ list_models = glob.glob(os.path.join(settings.PROJECT_DIR, "models", "*.pt"))
181
+
182
+ for model_path in list_models:
183
+ model_name.append(os.path.basename(model_path))
184
+
185
+ for model_filename in model_name:
186
+ try:
187
+ seq = model_filename.split("_")[3]
188
+ if int(seq) == sequence_length:
189
+ sequence_model.append(model_filename)
190
+ except IndexError:
191
+ pass # Handle cases where the filename format doesn't match expected
192
+
193
+ if len(sequence_model) > 1:
194
+ accuracy = []
195
+ for filename in sequence_model:
196
+ acc = filename.split("_")[1]
197
+ accuracy.append(acc) # Convert accuracy to float for proper comparison
198
+ max_index = accuracy.index(max(accuracy))
199
+ final_model = os.path.join(settings.PROJECT_DIR, "models", sequence_model[max_index])
200
+ elif len(sequence_model) == 1:
201
+ final_model = os.path.join(settings.PROJECT_DIR, "models", sequence_model[0])
202
+ else:
203
+ print("No model found for the specified sequence length.") # Handle no models found case
204
+
205
+ return final_model
206
+
207
+ ALLOWED_VIDEO_EXTENSIONS = set(['mp4','gif','webm','avi','3gp','wmv','flv','mkv'])
208
+
209
+ def allowed_video_file(filename):
210
+ #print("filename" ,filename.rsplit('.',1)[1].lower())
211
+ if (filename.rsplit('.',1)[1].lower() in ALLOWED_VIDEO_EXTENSIONS):
212
+ return True
213
+ else:
214
+ return False
215
+ def index(request):
216
+ if request.method == 'GET':
217
+ video_upload_form = VideoUploadForm()
218
+ if 'file_name' in request.session:
219
+ del request.session['file_name']
220
+ if 'preprocessed_images' in request.session:
221
+ del request.session['preprocessed_images']
222
+ if 'faces_cropped_images' in request.session:
223
+ del request.session['faces_cropped_images']
224
+ return render(request, index_template_name, {"form": video_upload_form})
225
+ else:
226
+ video_upload_form = VideoUploadForm(request.POST, request.FILES)
227
+ if video_upload_form.is_valid():
228
+ video_file = video_upload_form.cleaned_data['upload_video_file']
229
+ video_file_ext = video_file.name.split('.')[-1]
230
+ sequence_length = video_upload_form.cleaned_data['sequence_length']
231
+ video_content_type = video_file.content_type.split('/')[0]
232
+ if video_content_type in settings.CONTENT_TYPES:
233
+ if video_file.size > int(settings.MAX_UPLOAD_SIZE):
234
+ video_upload_form.add_error("upload_video_file", "Maximum file size 100 MB")
235
+ return render(request, index_template_name, {"form": video_upload_form})
236
+
237
+ if sequence_length <= 0:
238
+ video_upload_form.add_error("sequence_length", "Sequence Length must be greater than 0")
239
+ return render(request, index_template_name, {"form": video_upload_form})
240
+
241
+ if allowed_video_file(video_file.name) == False:
242
+ video_upload_form.add_error("upload_video_file","Only video files are allowed ")
243
+ return render(request, index_template_name, {"form": video_upload_form})
244
+
245
+ saved_video_file = 'uploaded_file_'+str(int(time.time()))+"."+video_file_ext
246
+ if settings.DEBUG:
247
+ with open(os.path.join(settings.PROJECT_DIR, 'uploaded_videos', saved_video_file), 'wb') as vFile:
248
+ shutil.copyfileobj(video_file, vFile)
249
+ request.session['file_name'] = os.path.join(settings.PROJECT_DIR, 'uploaded_videos', saved_video_file)
250
+ else:
251
+ with open(os.path.join(settings.PROJECT_DIR, 'uploaded_videos','app','uploaded_videos', saved_video_file), 'wb') as vFile:
252
+ shutil.copyfileobj(video_file, vFile)
253
+ request.session['file_name'] = os.path.join(settings.PROJECT_DIR, 'uploaded_videos','app','uploaded_videos', saved_video_file)
254
+ request.session['sequence_length'] = sequence_length
255
+ return redirect('ml_app:predict')
256
+ else:
257
+ return render(request, index_template_name, {"form": video_upload_form})
258
+
259
+ def predict_page(request):
260
+ if request.method == "GET":
261
+ # Redirect to 'home' if 'file_name' is not in session
262
+ if 'file_name' not in request.session:
263
+ return redirect("ml_app:home")
264
+ if 'file_name' in request.session:
265
+ video_file = request.session['file_name']
266
+ if 'sequence_length' in request.session:
267
+ sequence_length = request.session['sequence_length']
268
+ path_to_videos = [video_file]
269
+ video_file_name = os.path.basename(video_file)
270
+ video_file_name_only = os.path.splitext(video_file_name)[0]
271
+ # Production environment adjustments
272
+ if not settings.DEBUG:
273
+ production_video_name = os.path.join('/home/app/staticfiles/', video_file_name.split('/')[3])
274
+ print("Production file name", production_video_name)
275
+ else:
276
+ production_video_name = video_file_name
277
+
278
+ # Load validation dataset
279
+ video_dataset = validation_dataset(path_to_videos, sequence_length=sequence_length, transform=train_transforms)
280
+
281
+ # Load model
282
+ if(device == "gpu"):
283
+ model = Model(2).cuda() # Adjust the model instantiation according to your model structure
284
+ else:
285
+ model = Model(2).cpu() # Adjust the model instantiation according to your model structure
286
+ model_name = os.path.join(settings.PROJECT_DIR, 'models', get_accurate_model(sequence_length))
287
+ path_to_model = os.path.join(settings.PROJECT_DIR, model_name)
288
+ model.load_state_dict(torch.load(path_to_model, map_location=torch.device('cpu')))
289
+ model.eval()
290
+ start_time = time.time()
291
+ # Display preprocessing images
292
+ print("<=== | Started Videos Splitting | ===>")
293
+ preprocessed_images = []
294
+ faces_cropped_images = []
295
+ cap = cv2.VideoCapture(video_file)
296
+ frames = []
297
+ while cap.isOpened():
298
+ ret, frame = cap.read()
299
+ if ret:
300
+ frames.append(frame)
301
+ else:
302
+ break
303
+ cap.release()
304
+
305
+ print(f"Number of frames: {len(frames)}")
306
+ # Process each frame for preprocessing and face cropping
307
+ padding = 40
308
+ faces_found = 0
309
+ for i in range(sequence_length):
310
+ if i >= len(frames):
311
+ break
312
+ frame = frames[i]
313
+
314
+ # Convert BGR to RGB
315
+ rgb_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
316
+
317
+ # Save preprocessed image
318
+ image_name = f"{video_file_name_only}_preprocessed_{i+1}.png"
319
+ image_path = os.path.join(settings.PROJECT_DIR, 'uploaded_images', image_name)
320
+ img_rgb = pImage.fromarray(rgb_frame, 'RGB')
321
+ img_rgb.save(image_path)
322
+ preprocessed_images.append(image_name)
323
+
324
+ # Face detection and cropping
325
+ face_locations = face_recognition.face_locations(rgb_frame)
326
+ if len(face_locations) == 0:
327
+ continue
328
+
329
+ top, right, bottom, left = face_locations[0]
330
+ frame_face = frame[top - padding:bottom + padding, left - padding:right + padding]
331
+
332
+ # Convert cropped face image to RGB and save
333
+ rgb_face = cv2.cvtColor(frame_face, cv2.COLOR_BGR2RGB)
334
+ img_face_rgb = pImage.fromarray(rgb_face, 'RGB')
335
+ image_name = f"{video_file_name_only}_cropped_faces_{i+1}.png"
336
+ image_path = os.path.join(settings.PROJECT_DIR, 'uploaded_images', image_name)
337
+ img_face_rgb.save(image_path)
338
+ faces_found += 1
339
+ faces_cropped_images.append(image_name)
340
+
341
+ print("<=== | Videos Splitting and Face Cropping Done | ===>")
342
+ print("--- %s seconds ---" % (time.time() - start_time))
343
+
344
+ # No face detected
345
+ if faces_found == 0:
346
+ return render(request, 'predict_template_name.html', {"no_faces": True})
347
+
348
+ # Perform prediction
349
+ try:
350
+ heatmap_images = []
351
+ output = ""
352
+ confidence = 0.0
353
+
354
+ for i in range(len(path_to_videos)):
355
+ print("<=== | Started Prediction | ===>")
356
+ prediction = predict(model, video_dataset[i], './', video_file_name_only)
357
+ confidence = round(prediction[1], 1)
358
+ output = "REAL" if prediction[0] == 1 else "FAKE"
359
+ print("Prediction:", prediction[0], "==", output, "Confidence:", confidence)
360
+ print("<=== | Prediction Done | ===>")
361
+ print("--- %s seconds ---" % (time.time() - start_time))
362
+
363
+ # Uncomment if you want to create heat map images
364
+ # for j in range(sequence_length):
365
+ # heatmap_images.append(plot_heat_map(j, model, video_dataset[i], './', video_file_name_only))
366
+
367
+ # Render results
368
+ context = {
369
+ 'preprocessed_images': preprocessed_images,
370
+ 'faces_cropped_images': faces_cropped_images,
371
+ 'heatmap_images': heatmap_images,
372
+ 'original_video': production_video_name,
373
+ 'models_location': os.path.join(settings.PROJECT_DIR, 'models'),
374
+ 'output': output,
375
+ 'confidence': confidence
376
+ }
377
+
378
+ if settings.DEBUG:
379
+ return render(request, predict_template_name, context)
380
+ else:
381
+ return render(request, predict_template_name, context)
382
+
383
+ except Exception as e:
384
+ print(f"Exception occurred during prediction: {e}")
385
+ return render(request, 'cuda_full.html')
386
+ def about(request):
387
+ return render(request, about_template_name)
388
+
389
+ def handler404(request,exception):
390
+ return render(request, '404.html', status=404)
391
+ def cuda_full(request):
392
+ return render(request, 'cuda_full.html')
models/model_95_acc_40_frames_FF_data.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a1a8484005389c1a9ae24625f4502b01e4a101c92ef7fbd775911b02f8da276c
3
+ size 226547587
nginx/Dockerfile ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ FROM nginx
2
+ WORKDIR /etc/nginx/
3
+ RUN rm /etc/nginx/conf.d/default.conf
4
+ COPY nginx.conf /etc/nginx/conf.d
5
+ EXPOSE 80
nginx/nginx.conf ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ upstream project_settings {
2
+ server unix:/app/run/gunicorn.sock
3
+ fail_timeout=0;
4
+ }
5
+
6
+ server {
7
+
8
+ listen 80;
9
+ # disable any limits to avoid HTTP 413 for large image uploads
10
+ client_max_body_size 0;
11
+
12
+ location / {
13
+ if (!-f $request_filename) {
14
+ proxy_pass http://project_settings;
15
+ break;
16
+ }
17
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
18
+ proxy_set_header Host $host;
19
+ proxy_redirect off;
20
+ }
21
+ #static file directory
22
+ location /static/ {
23
+ alias /home/app/staticfiles/;
24
+ }
25
+ #media file directory
26
+ location /media/ {
27
+ alias /app/uploaded_videos/;
28
+ }
29
+ }
30
+
31
+
project_settings/__init__.py ADDED
File without changes
project_settings/__pycache__/__init__.cpython-36.pyc ADDED
Binary file (172 Bytes). View file
 
project_settings/__pycache__/__init__.cpython-38.pyc ADDED
Binary file (154 Bytes). View file
 
project_settings/__pycache__/settings.cpython-36.pyc ADDED
Binary file (1.92 kB). View file
 
project_settings/__pycache__/settings.cpython-38.pyc ADDED
Binary file (1.92 kB). View file
 
project_settings/__pycache__/urls.cpython-36.pyc ADDED
Binary file (524 Bytes). View file
 
project_settings/__pycache__/urls.cpython-38.pyc ADDED
Binary file (510 Bytes). View file
 
project_settings/__pycache__/wsgi.cpython-36.pyc ADDED
Binary file (593 Bytes). View file
 
project_settings/__pycache__/wsgi.cpython-38.pyc ADDED
Binary file (575 Bytes). View file
 
project_settings/asgi.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ ASGI config for project_settings project.
3
+
4
+ It exposes the ASGI callable as a module-level variable named ``application``.
5
+
6
+ For more information on this file, see
7
+ https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
8
+ """
9
+
10
+ import os
11
+
12
+ from django.core.asgi import get_asgi_application
13
+
14
+ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project_settings.settings')
15
+
16
+ application = get_asgi_application()
project_settings/settings.py ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Django settings for project_settings project.
3
+ """
4
+
5
+ import os
6
+
7
+ # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
8
+ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
9
+
10
+ # Build paths inside the project like this: os.path.join(PROJECT_DIR, ...)
11
+ PROJECT_DIR = os.path.abspath(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
12
+
13
+
14
+ # Quick-start development settings - unsuitable for production
15
+ # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
16
+
17
+ # SECURITY WARNING: keep the secret key used in production secret!
18
+ SECRET_KEY = '@)0qp0!&-vht7k0wyuihr+nk-b8zrvb5j^1d@vl84cd1%)f=dz'
19
+
20
+ # SECURITY WARNING: don't run with debug turned on in production!
21
+ DEBUG = True
22
+
23
+ # Change and set this to correct IP/Domain
24
+ ALLOWED_HOSTS = ["*"]
25
+
26
+
27
+ # Application definition
28
+
29
+ INSTALLED_APPS = [
30
+ 'django.contrib.contenttypes',
31
+ 'django.contrib.sessions',
32
+ 'django.contrib.messages',
33
+ 'django.contrib.staticfiles',
34
+ 'ml_app.apps.MlAppConfig'
35
+ ]
36
+
37
+ MIDDLEWARE = [
38
+ 'django.middleware.security.SecurityMiddleware',
39
+ 'django.contrib.sessions.middleware.SessionMiddleware',
40
+ 'django.middleware.common.CommonMiddleware',
41
+ 'django.middleware.csrf.CsrfViewMiddleware',
42
+ 'django.contrib.messages.middleware.MessageMiddleware',
43
+ 'django.middleware.clickjacking.XFrameOptionsMiddleware',
44
+ ]
45
+
46
+ ROOT_URLCONF = 'project_settings.urls'
47
+
48
+ TEMPLATES = [
49
+ {
50
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
51
+ 'DIRS': [os.path.join(PROJECT_DIR, 'templates')],
52
+ 'APP_DIRS': True,
53
+ 'OPTIONS': {
54
+ 'context_processors': [
55
+ 'django.template.context_processors.debug',
56
+ 'django.template.context_processors.request',
57
+ 'django.contrib.messages.context_processors.messages',
58
+ 'django.template.context_processors.media'
59
+ ],
60
+ },
61
+ },
62
+ ]
63
+
64
+ WSGI_APPLICATION = 'project_settings.wsgi.application'
65
+
66
+
67
+ # Database
68
+ # https://docs.djangoproject.com/en/3.0/ref/settings/#databases
69
+
70
+ DATABASES = {
71
+ "default": {
72
+ "ENGINE": "django.db.backends.sqlite3",
73
+ "NAME": os.path.join(PROJECT_DIR, 'db.sqlite3'),
74
+ }
75
+ }
76
+
77
+
78
+ # Internationalization
79
+ # https://docs.djangoproject.com/en/3.0/topics/i18n/
80
+
81
+ LANGUAGE_CODE = 'en-us'
82
+
83
+ TIME_ZONE = 'UTC'
84
+
85
+ USE_I18N = False
86
+
87
+ USE_L10N = False
88
+
89
+ USE_TZ = False
90
+
91
+
92
+ # Static files (CSS, JavaScript, Images)
93
+ # https://docs.djangoproject.com/en/3.0/howto/static-files/
94
+
95
+ #used in production to serve static files
96
+ STATIC_ROOT = "/home/app/staticfiles/"
97
+
98
+ #url for static files
99
+ STATIC_URL = '/static/'
100
+
101
+ STATICFILES_DIRS = [
102
+ os.path.join(PROJECT_DIR, 'uploaded_images'),
103
+ os.path.join(PROJECT_DIR, 'static'),
104
+ os.path.join(PROJECT_DIR, 'models'),
105
+ ]
106
+
107
+ CONTENT_TYPES = ['video']
108
+ MAX_UPLOAD_SIZE = "104857600"
109
+
110
+ MEDIA_URL = "/media/"
111
+
112
+ MEDIA_ROOT = os.path.join(PROJECT_DIR, 'uploaded_videos')
113
+
114
+ #for extra logging in production environment
115
+ if DEBUG == False:
116
+ LOGGING = {
117
+ 'version': 1,
118
+ 'disable_existing_loggers': False,
119
+ 'handlers': {
120
+ 'console': {
121
+ 'class': 'logging.StreamHandler',
122
+ },
123
+ 'file': {
124
+ 'level': 'DEBUG',
125
+ 'class': 'logging.FileHandler',
126
+ 'filename': 'log.django',
127
+ },
128
+ },
129
+ 'loggers': {
130
+ 'django': {
131
+ 'handlers': ['console','file'],
132
+ 'level': os.getenv('DJANGO_LOG_LEVEL', 'DEBUG'),
133
+ },
134
+ },
135
+ }
project_settings/urls.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """project_settings URL Configuration
2
+ """
3
+ from django.contrib import admin
4
+ from django.urls import path, include
5
+
6
+ from django.conf import settings
7
+ from django.conf.urls.static import static
8
+
9
+ urlpatterns = [
10
+ path('', include('ml_app.urls')),
11
+ ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
project_settings/wsgi.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ WSGI config for project_settings 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/3.0/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', 'project_settings.settings')
15
+
16
+ application = get_wsgi_application()
requirements.txt ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ altair==5.3.0
2
+ asgiref==3.8.1
3
+ astor==0.8.1
4
+ attrs==23.2.0
5
+ backcall==0.2.0
6
+ base58==2.1.1
7
+ bleach==6.1.0
8
+ blinker==1.8.2
9
+ cachetools==5.3.3
10
+ certifi==2024.6.2
11
+ chardet==5.2.0
12
+ click==8.1.7
13
+ cmake==3.29.6
14
+ colorama==0.4.6
15
+ cycler==0.12.1
16
+ decorator==5.1.1
17
+ defusedxml==0.7.1
18
+ Django==5.0.6
19
+ dlib==19.24.2
20
+ docutils==0.21.2
21
+ entrypoints==0.4
22
+ enum-compat==0.0.3
23
+ face-recognition==1.3.0
24
+ face-recognition-models==0.3.0
25
+ future==1.0.0
26
+ google==3.0.0
27
+ google-api-core==2.19.1
28
+ google-api-python-client==2.134.0
29
+ google-auth==2.30.0
30
+ google-auth-httplib2==0.2.0
31
+ googleapis-common-protos==1.63.2
32
+ httplib2==0.22.0
33
+ idna==3.7
34
+ ipykernel==6.29.4
35
+ ipython==8.12.3
36
+ ipython-genutils==0.2.0
37
+ ipywidgets==8.1.3
38
+ jedi==0.16.0
39
+ Jinja2==3.1.4
40
+ jmespath==1.0.1
41
+ json5==0.9.25
42
+ jsonschema==4.22.0
43
+ jupyter-client==8.6.2
44
+ jupyter-core==5.7.2
45
+ jupyterlab==4.2.2
46
+ jupyterlab-server==2.27.2
47
+ kiwisolver==1.4.5
48
+ MarkupSafe==2.1.5
49
+ matplotlib==3.9.0
50
+ mistune==3.0.2
51
+ nbconvert==7.16.4
52
+ nbformat==5.10.4
53
+ notebook==7.2.1
54
+ numpy===1.26.4
55
+ opencv-python==4.10.0.84
56
+ packaging==24.1
57
+ pandas==2.2.2
58
+ pandocfilters==1.5.1
59
+ parso==0.8.4
60
+ pathtools==0.1.2
61
+ pickleshare==0.7.5
62
+ Pillow==10.3.0
63
+ prometheus-client==0.20.0
64
+ prompt-toolkit==3.0.47
65
+ protobuf==5.27.2
66
+ pyasn1==0.6.0
67
+ pyasn1-modules==0.4.0
68
+ pycodestyle==2.12.0
69
+ pydeck==0.9.0b1
70
+ Pygments==2.18.0
71
+ pyparsing==3.1.2
72
+ pyrsistent==0.20.0
73
+ python-dateutil==2.9.0
74
+ # pytz==2019.3 Commenting for production deployment
75
+ # pywin32==227
76
+ pywinpty==0.5.7
77
+ PyYAML==6.0.1
78
+ pyzmq==26.0.3
79
+ requests==2.32.3
80
+ rsa==4.9
81
+ s3transfer==0.10.2
82
+ Send2Trash==1.8.3
83
+ six==1.16.0
84
+ soupsieve==2.5
85
+ sqlparse==0.5.0
86
+ terminado==0.18.1
87
+ testpath==0.6.0
88
+ toml==0.10.2
89
+ toolz==0.12.1
90
+ torch==2.3.1
91
+ torchvision==0.18.1
92
+ tornado==6.4.1
93
+ traitlets==5.14.3
94
+ tzlocal==5.2
95
+ uritemplate==4.1.1
96
+ urllib3==2.2.2
97
+ validators==0.28.3
98
+ watchdog==4.0.1
99
+ wcwidth==0.2.13
100
+ webencodings==0.5.1
101
+ widgetsnbextension==4.0.11