Skip to content

Commit

Permalink
adding examples
Browse files Browse the repository at this point in the history
  • Loading branch information
dc086989 committed Dec 19, 2024
1 parent ee69ccd commit 412649c
Show file tree
Hide file tree
Showing 26 changed files with 180 additions and 214 deletions.
333 changes: 161 additions & 172 deletions gradio/app.py

Large diffs are not rendered by default.

Binary file removed gradio/images/band_credit_card/demo1.jpg
Binary file not shown.
Binary file removed gradio/images/band_credit_card/demo2.png
Binary file not shown.
Binary file removed gradio/images/band_credit_card/demo3.png
Binary file not shown.
Binary file removed gradio/images/id/demo1.jpg
Binary file not shown.
Binary file removed gradio/images/id/demo2.png
Binary file not shown.
Binary file removed gradio/images/id/demo3.png
Binary file not shown.
Binary file added gradio/images/img1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gradio/images/img2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gradio/images/img3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gradio/images/img4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gradio/images/img5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gradio/images/img6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gradio/images/img7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed gradio/images/mrz_barcode/demo1.png
Binary file not shown.
Binary file removed gradio/images/mrz_barcode/demo2.png
Binary file not shown.
27 changes: 0 additions & 27 deletions python/check_mrz.py

This file was deleted.

14 changes: 7 additions & 7 deletions python/check_id.py → python/face_detect.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import requests

# URL of the API endpoint
url = 'http://127.0.0.1:8082/api/check_id'
# URL of the web API endpoint
url = 'http://127.0.0.1:8083/api/face_detect'

# Path to the image file you want to send
image_path = './test_image/id_image.jpg'
image_path = './test_image/img1.jpg'

# Read the image file and encode it as a base64 string
# Read the image file and send it as form data
files = {'image': open(image_path, 'rb')}

try:
Expand All @@ -17,11 +17,11 @@
if response.status_code == 200:
print('Request was successful!')
# Parse the JSON response
response_data = response.content
print('Response Data :', response_data)
response_data = response.json()
print('Response Data:', response_data)
else:
print('Request failed with status code:', response.status_code)
print('Response content:', response.text)

except requests.exceptions.RequestException as e:
print('An error occurred:', e)
print('An error occurred:', e)
20 changes: 12 additions & 8 deletions python/check_credit.py → python/face_match.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import requests

# URL of the API endpoint
url = 'http://127.0.0.1:8082/api/check_credit'
# URL of the web API endpoint
url = 'http://127.0.0.1:8083/api/face_match'

# Path to the image file you want to send
image_path = './test_image/bank_card_image.png'
image_path_1 = './test_image/img1.jpg'
image_path_2 = './test_image/img2.jpg'

# Read the image file and encode it as a base64 string
files = {'image': open(image_path, 'rb')}
# Read the image file and send it as form data
files = {
'image1': open(image_path_1, 'rb'),
'image2': open(image_path_2, 'rb')
}

try:
# Send POST request
Expand All @@ -17,11 +21,11 @@
if response.status_code == 200:
print('Request was successful!')
# Parse the JSON response
response_data = response.content
print('Response Data :', response_data)
response_data = response.json()
print('Response Data:', response_data)
else:
print('Request failed with status code:', response.status_code)
print('Response content:', response.text)

except requests.exceptions.RequestException as e:
print('An error occurred:', e)
print('An error occurred:', e)
Binary file removed python/test_image/bank_card_image.png
Binary file not shown.
Binary file removed python/test_image/id_image.jpg
Binary file not shown.
Binary file added python/test_image/img1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added python/test_image/img2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added python/test_image/img3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added python/test_image/img4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed python/test_image/mrz_image.png
Binary file not shown.

0 comments on commit 412649c

Please sign in to comment.