Commit 96041bdb authored by SohanDanushka's avatar SohanDanushka

Showing the main states of a selected video from the frontend.

parent bef01269
from rest_framework.views import APIView
from rest_framework.response import Response
from . logic import classroom_activity
class ActivityRecognitionAPI(APIView):
def get(self, request):
pass
def post(self, request):
video_name = request.data['video_name']
percentages = classroom_activity.activity_recognition(video_name)
return Response({"response": percentages})
\ No newline at end of file
......@@ -2,10 +2,11 @@ from django.urls import path, re_path, include
from . import views
from rest_framework import routers
from django.conf.urls import url
from . import api
# router = routers.DefaultRouter()
router = routers.DefaultRouter()
# router.register(r'^register', views.register)
urlpatterns = [
......@@ -23,4 +24,10 @@ urlpatterns = [
path('base', views.base),
path('child', views.child),
# path('Video', views.hello)
# API to retrieve activity recognition
url(r'^activities', api.ActivityRecognitionAPI.as_view()),
path('api-auth/', include('rest_framework.urls', namespace='rest_framework'))
]
\ No newline at end of file
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