optimised-ocr / sample.py
AuditEdge's picture
initial commit
81e13bb
import requests
# Define the API endpoint
# url = "http://127.0.0.0:7860/api/home"
post_url = "http://localhost:7860/api/aadhar_ocr"
# response = requests.get(url)
# print()
# Define the file pathscd
files = {
"aadhar_file": open("/home/javmulla/model_one/test_images_aadhar/test_two.jpg", "rb"),
"pan_file": open("/home/javmulla/model_one/test_images_pan/6ea33087.jpeg", "rb"),
"cheque_file": open("/home/javmulla/model_one/test_images_cheque/0f81678a.jpeg", "rb"),
"gst_file": open("/home/javmulla/model_one/test_images_gst/0a52fbcb_page3_image_0.jpg", "rb"),
}
response = requests.post(post_url, files=files)
# # Print the response
print("Status Code:", response.status_code)
print("Response Text:", response.text)