ConradLax commited on
Commit
8c40583
·
1 Parent(s): 41d3948

fix: error in opening url image

Browse files
Files changed (1) hide show
  1. main.py +3 -2
main.py CHANGED
@@ -135,8 +135,9 @@ import os
135
  import requests
136
 
137
  def classify_acct_dtype_str(input_path):
138
- response = requests.get("https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/city-streets.jpg")
139
- dtype_inf, dtype_conf = doctype_classify(response, "city-streets.jpg")
 
140
 
141
  return dtype_inf
142
 
 
135
  import requests
136
 
137
  def classify_acct_dtype_str(input_path):
138
+ # response = requests.get("https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/city-streets.jpg")
139
+ ipt = Image.open(input_path)
140
+ dtype_inf, dtype_conf = doctype_classify(ipt, "city-streets.jpg")
141
 
142
  return dtype_inf
143