valencar commited on
Commit
9bdd240
·
1 Parent(s): 6842574
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -51,11 +51,18 @@ def predict_image(name_image):
51
  from PIL import Image
52
  import requests
53
 
54
- url = "https://huggingface.co/valencar/modelo_raios_x/blob/main/dados_teste/CHNCXR_0001_0.png"
55
 
56
- req = requests.get(url, stream=True).raw
57
- #image_hf = Image.open(req)
58
- image_hf = req
 
 
 
 
 
 
 
 
59
 
60
  img = img_orig = image.load_img(image_hf, target_size = (IMAGE_HEIGHT, IMAGE_WIDTH))
61
  img = image.img_to_array(img)
 
51
  from PIL import Image
52
  import requests
53
 
 
54
 
55
+
56
+ # url = "https://huggingface.co/valencar/modelo_raios_x/blob/main/dados_teste/CHNCXR_0001_0.png"
57
+
58
+ # req = requests.get(url, stream=True).raw
59
+ # #image_hf = Image.open(req)
60
+ # image_hf = req
61
+
62
+ imagem = Image.open(name_image)
63
+ imagem.save("image_raiox","png")
64
+ nome_imagem_salva = 'image_raiox.png'
65
+ image_hf = nome_imagem_salva
66
 
67
  img = img_orig = image.load_img(image_hf, target_size = (IMAGE_HEIGHT, IMAGE_WIDTH))
68
  img = image.img_to_array(img)