예제 #1
0
 def on_message(self, message):
     s1 = time.time()
     image_data = get_face_detect_data(message)
     s2 = time.time()
     logging.info("python time == " + str((s2 - s1) * 1000))
     if not image_data:
         image_data = message
     self.write_message(image_data)
예제 #2
0
 def post(self, request, *args, **kwargs):
     data = request.POST.get('image')
     try:
         image_data = get_face_detect_data(data)
         if image_data:
             return JsonResponse(status=200,
                                 data={
                                     'image': image_data,
                                     'message': 'Face detected'
                                 })
     except Exception as e:
         pass
     return JsonResponse(
         status=400, data={'errors': {
             'error_message': 'No face detected'
         }})
예제 #3
0
 def on_message(self, message):
     from main.detect import get_face_detect_data
     image_data = get_face_detect_data(message)
     if not image_data:
         image_data = message
     self.write_message(image_data)
예제 #4
0
 def on_message(self, message):
     image_data = get_face_detect_data(message)
     # logging.info("image read")
     if not image_data:
         image_data = message
     self.write_message(image_data)