mirror of
https://github.com/serengil/deepface.git
synced 2025-06-06 11:35:21 +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"])
|
||||
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:
|
||||
img = extract_image_from_request("img")
|
||||
@ -96,7 +98,9 @@ def represent():
|
||||
|
||||
@blueprint.route("/verify", methods=["POST"])
|
||||
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:
|
||||
img1 = extract_image_from_request("img1")
|
||||
@ -126,7 +130,9 @@ def verify():
|
||||
|
||||
@blueprint.route("/analyze", methods=["POST"])
|
||||
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:
|
||||
img = extract_image_from_request("img")
|
||||
|
Loading…
x
Reference in New Issue
Block a user