File name
Commit message
Commit date
후처리 모듈 및 메인 서버 전달을 위한 수정 1. ITS cctv 스트리밍 정보를 하나의 프로세스가 하나의 영상을 담당하여 처리 및 실행하기 위한 스크립트와 bash 스크립트 2. FrameCapturer 객체에 위경도 정보 필수 arg
05-20
note to myself : http headers does not use '_', and will be converted into '-', and by convention, should use captical letter at the first letter of each words.
05-24
import numpy as np
from flask import Flask, request
from flask_restx import Api, Resource, fields
import os
from datetime import datetime
from yoloseg.inference_ import Inference, overlay_mask
import cv2
import time
import base64
app = Flask(__name__)
api = Api(app, version='1.0', title='Detection postprocessing component',
description='A postprocessing that dynamically decides how frequently send image and detection result')
# Namespace definition
ns = api.namespace('cctv', description='CCTV operations')
@ns.route('/postprocess', )
class get_inference_result(Resource):
def __init__(self):
super().__init__(api)
self.time_sent = None
self.cctv_latitude = None
self.cctv_longitude = None
self.cctv_info = None
self.mask = None
self.image = None
self.image_type = None
self.area_percent = 0
@ns.response(200, 'Success')
@ns.response(400, 'Validation Error')
def post(self):
self.image = request.files['image']
self.mask = request.files['mask']
self.cctv_info = base64.b64decode(request.headers.get('x-cctv-name', '')).decode('UTF-8')
self.cctv_latitude = request.headers.get('x-cctv-latitude')
self.cctv_longitude = request.headers.get('x-cctv-longitude')
self.image_type = request.headers.get('Content-Type')
self.area_percent = request.headers.get('x-area-percentage')
async def data_ping_pong(self):
pass