Commit 05235363 authored by Wanigasinghe N.T. | IT18229912's avatar Wanigasinghe N.T. | IT18229912

Merge branch 'feat/it18229912' into 'develop'

feat: Add testing UI for BE integerations

See merge request !23
parents ebc214ba 150df063
...@@ -22,7 +22,7 @@ import numpy as np ...@@ -22,7 +22,7 @@ import numpy as np
"""Upload the video to the Google colab and get the path of the video and xml file""" """Upload the video to the Google colab and get the path of the video and xml file"""
location_videofile = "F:\\CDAP-PRESENTLY\\21_22-j-02\\Presently\\presently\\media\\video\\22\\testvideo_UbZvefG.mp4" location_videofile = "F:\\CDAP-PRESENTLY\\21_22-j-02\\Presently\\presently\\media\\video\\22\\testvideo.mp4"
cascPath = "F:\\CDAP-PRESENTLY\\21_22-j-02\\Presently\\presently\\users\\models\\abc.xml" cascPath = "F:\\CDAP-PRESENTLY\\21_22-j-02\\Presently\\presently\\users\\models\\abc.xml"
"""Get labels to each emotion""" """Get labels to each emotion"""
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
<h3><b>Password</b> : **********</h3> <h3><b>Password</b> : **********</h3>
<div class="my-5"> <div class="my-5">
<a class="btn btn-info" href="{% url 'feedback' %}" type="submit">Watch your Uploaded Videos</a> <a class="btn btn-info" href="{% url 'feedback' %}" type="submit">Watch your Uploaded Videos</a>
<a class="btn btn-info" href="{% url 'test' %}" type="submit">TEST</a>
</div> </div>
</div> </div>
</div> </div>
......
{% extends 'users/base.html' %}
{% load crispy_forms_tags %}
{% load static %}
{% block content %}
<!-- {% for key, value in predictions.items %}
<h2>{{ forloop.counter }}. {{ key }} : {{ value }}</h2>
{% endfor %} -->
<div class="container">
<div class="heading-text heading-line text-center mt-5">
<h4>Summery of emotions</h4>
</div>
<div class="text-center py-4">
<h2>The Most Used Emotion for this session: <span style="color:rgb(25, 143, 216)">{{ maxemotion }}</span></h2>
</div>
<div class="row pb-5">
{% for key, value in predictions.items %}
<div class="col-lg-3 text-center"> <span class="pie-chart" data-percent="{{ value }}"> <span
class="percent"></span> </span>
<h4>{{ key }}</h4>
<p>{{ value }}</p>
</div>
{% endfor %}
</div>
<hr/>
<div class="heading-text heading-line text-center mt-5">
<h4>Usage of body gestures</h4>
</div>
<h5 class="py-5">Waiting...</h5>
</div>
{% endblock %}
\ No newline at end of file
...@@ -15,4 +15,6 @@ urlpatterns = [ ...@@ -15,4 +15,6 @@ urlpatterns = [
path('feedback/emotion/audio/prosody', views.emotionaudioprosody, name='emotionaudioprosody'), path('feedback/emotion/audio/prosody', views.emotionaudioprosody, name='emotionaudioprosody'),
path('login/', auth_view.LoginView.as_view(template_name='users/login.html'), name="login"), path('login/', auth_view.LoginView.as_view(template_name='users/login.html'), name="login"),
path('logout/', auth_view.LogoutView.as_view(template_name='users/logout.html'), name="logout"), path('logout/', auth_view.LogoutView.as_view(template_name='users/logout.html'), name="logout"),
path('test/', views.test, name='test'),
] ]
from array import array
from http.client import HTTPResponse from http.client import HTTPResponse
from django.shortcuts import render, redirect from django.shortcuts import render, redirect
from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.forms import UserCreationForm
...@@ -6,6 +7,18 @@ from django.contrib import messages ...@@ -6,6 +7,18 @@ from django.contrib import messages
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from .forms import Video_form from .forms import Video_form
from .models import Video from .models import Video
from django.template import Template, Context
import datetime
from . import emotiondetectionvideo
def test(request):
emotion= emotiondetectionvideo.emo
arr= emotiondetectionvideo.arr1
context= {
'maxemotion': emotion,
'predictions': arr
}
return render(request, 'users/test.html',context)
def home(request): def home(request):
all_video=Video.objects.all() all_video=Video.objects.all()
...@@ -62,3 +75,4 @@ def register(request): ...@@ -62,3 +75,4 @@ def register(request):
@login_required() @login_required()
def profile(request): def profile(request):
return render(request, 'users/profile.html') return render(request, 'users/profile.html')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment