def make_url_chiffon(filepath_img, result_recog, dict_conf): dict_query = make_dict_query_ch(filepath_img, result_recog, dict_conf) url_chiffon = myutils.get_url_request( dict_conf["chiffon_server"]["host"], dict_conf["chiffon_server"]["port"], [dict_conf["chiffon_server"]["path_receiver"]], dict_query) return url_chiffon
def sendToChiffon(filepath_img, dict_conf, result_recog): # dict_recog=convert_recjson_to_idjson(result_recog,dict_conf) # url_chiffon=make_url_chiffon(filepath_img,dict_recog,dict_conf) dir_img = os.path.dirname(filepath_img) timestamp = myutils.get_time_stamp( dict_conf["chiffon_server"]["timestamp"]) dict_string = { "navigator": dict_conf["chiffon_server"]["navigator"], "action": { "target": result_recog, "name": dir_img, "timestamp": timestamp } } dict_query = { "session_id": dict_conf["session_id"], "string": json.dumps(dict_string) } url_chiffon = myutils.get_url_request( dict_conf["chiffon_server"]["host"], dict_conf["chiffon_server"]["port"], [dict_conf["chiffon_server"]["path_receiver"]], dict_query) print("URL(chiffon)..." + url_chiffon) if (dict_conf["product_env"]["is_product"] == "1"): get_http_result(url_chiffon) print( "Result from server4recog has been successfully sent to CHIFFON server." )
def make_url_server4recog(filepath_img, feature_extracted, dict_conf): dict_query = make_dict_query_s4r(filepath_img, feature_extracted, dict_conf) url_recog = myutils.get_url_request(dict_conf["serv4recog"]["host"], dict_conf["serv4recog"]["port"], [dict_conf["serv4recog"]["path"]], dict_query) return url_recog
def get_recipeid(dict_conf,session_id): url_recipe=myutils.get_url_request(dict_conf["chiffon_server"]["host"],dict_conf["chiffon_server"]["port"],[dict_conf["chiffon_server"]["path_recipe"],session_id]) recipe_id=myutils.get_recipe_id(url_recipe) return recipe_id
def get_sessionid(dict_conf): url_session=myutils.get_url_request(dict_conf["chiffon_server"]["host"],dict_conf["chiffon_server"]["port"],[dict_conf["chiffon_server"]["path_sessionid"],dict_conf["user_id"]]) session_id=myutils.get_session_id(url_session) return session_id
def get_sessionid(dict_conf): url_session=myutils.get_url_request(dict_conf["chiffon_server"]["host"],dict_conf["chiffon_server"]["port"],[dict_conf["chiffon_server"]["path_sessionid"],dict_conf["user_id"]]) session_id=myutils.get_session_id(url_session) print("session_id:{session_id}".format(session_id=session_id)) return session_id