mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 12:05:22 +00:00
Update routes.py
support form data for flask 3
This commit is contained in:
parent
b4ffec1a2f
commit
4fe4ba289e
@ -72,7 +72,9 @@ def extract_image_from_request(img_key: str) -> Union[str, np.ndarray]:
|
|||||||
|
|
||||||
@blueprint.route("/represent", methods=["POST"])
|
@blueprint.route("/represent", methods=["POST"])
|
||||||
def represent():
|
def represent():
|
||||||
input_args = request.get_json() or request.form.to_dict()
|
input_args = (request.is_json and request.get_json()) or (
|
||||||
|
request.form and request.form.to_dict()
|
||||||
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
img = extract_image_from_request("img")
|
img = extract_image_from_request("img")
|
||||||
@ -96,7 +98,9 @@ def represent():
|
|||||||
|
|
||||||
@blueprint.route("/verify", methods=["POST"])
|
@blueprint.route("/verify", methods=["POST"])
|
||||||
def verify():
|
def verify():
|
||||||
input_args = request.get_json() or request.form.to_dict()
|
input_args = (request.is_json and request.get_json()) or (
|
||||||
|
request.form and request.form.to_dict()
|
||||||
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
img1 = extract_image_from_request("img1")
|
img1 = extract_image_from_request("img1")
|
||||||
@ -126,7 +130,9 @@ def verify():
|
|||||||
|
|
||||||
@blueprint.route("/analyze", methods=["POST"])
|
@blueprint.route("/analyze", methods=["POST"])
|
||||||
def analyze():
|
def analyze():
|
||||||
input_args = request.get_json() or request.form.to_dict()
|
input_args = (request.is_json and request.get_json()) or (
|
||||||
|
request.form and request.form.to_dict()
|
||||||
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
img = extract_image_from_request("img")
|
img = extract_image_from_request("img")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user