Skip to content

Commit ea90eb6

Browse files
Clean views.py code and remove commented code
1 parent 98f9a1c commit ea90eb6

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

demo/views.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# from rest_framework.decorators import api_view
21
from django.http import JsonResponse
3-
# from rest_framework.response import Response
4-
# from rest_framework import status
52
from channels import Group
63
from django.shortcuts import render
74
from django.views.decorators.csrf import csrf_exempt
@@ -15,7 +12,6 @@
1512
import os
1613
import random
1714
import traceback
18-
# import urllib2
1915
import demo.constants as constants
2016

2117
COCO_PARTIAL_IMAGE_NAME = constants.COCO_PARTIAL_IMAGE_NAME
@@ -32,16 +28,8 @@ def vilbert_multitask(request, template_name="index.html"):
3228
input_images_list = request.POST.getlist("image_list[]")
3329
print(input_images_list, input_question, task_id)
3430
abs_image_path = []
35-
# if len(input_images_list) == 1:
36-
# abs_image_path.append(str(os.path.join(settings.BASE_DIR, str(input_images_list[0][1:]))))
37-
# print("Absoulte image path", abs_image_path)
38-
# elif len(input_images_list) == 2:
39-
# for i in range(len(input_images_list)):
40-
# abs_image_path.append(str(os.path.join(settings.BASE_DIR, str(input_images_list[i][1:]))))
41-
# else:
4231
for i in range(len(input_images_list)):
4332
abs_image_path.append(str(os.path.join(settings.BASE_DIR, str(input_images_list[i][1:]))))
44-
# out_dir = os.path.dirname(abs_image_path)
4533
print(socketid, task_id, input_question, abs_image_path)
4634
# Run the Model wrapper
4735
log_to_terminal(socketid, {"terminal": "Starting Vilbert Multitask Job..."})
@@ -105,11 +93,6 @@ def file_upload(request):
10593
print("Image", images)
10694
socketid = request.POST.get('socketid')
10795
dir_type = constants.VILBERT_MULTITASK_CONFIG['image_dir']
108-
109-
# folder_uuid = uuid.uuid4()
110-
# output_dir = os.path.join(dir_type, str(folder_uuid))
111-
# if not os.path.exists(output_dir):
112-
# os.makedirs(output_dir)
11396
file_paths = []
11497
for i in images:
11598
image_uuid = uuid.uuid4()

0 commit comments

Comments
 (0)