Spaces:
Sleeping
Sleeping
Fernando Cervan
commited on
Commit
·
de53c78
1
Parent(s):
6976a55
Salvando alterações
Browse files
__pycache__/Inferencia.cpython-312.pyc
ADDED
Binary file (1.22 kB). View file
|
|
__pycache__/LogCustomizado.cpython-312.pyc
ADDED
Binary file (871 Bytes). View file
|
|
app.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
from LogCustomizado import LogCustomizado as logc
|
|
|
|
|
3 |
|
4 |
logc.gerar_log(mensagem_log="INICIANDO PROCESSO")
|
5 |
|
@@ -14,6 +16,15 @@ arquivos_upload = st.file_uploader(
|
|
14 |
help="O arquitvo PDF precisa ser uma imagem"
|
15 |
)
|
16 |
|
|
|
|
|
17 |
if arquivos_upload is not None:
|
18 |
-
for
|
19 |
-
st.write(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
from LogCustomizado import LogCustomizado as logc
|
3 |
+
from Inferencia import Inferencia
|
4 |
+
from PIL import Image
|
5 |
|
6 |
logc.gerar_log(mensagem_log="INICIANDO PROCESSO")
|
7 |
|
|
|
16 |
help="O arquitvo PDF precisa ser uma imagem"
|
17 |
)
|
18 |
|
19 |
+
inferencia = Inferencia()
|
20 |
+
|
21 |
if arquivos_upload is not None:
|
22 |
+
for arquivo in arquivos_upload:
|
23 |
+
st.write(arquivo.name)
|
24 |
+
st.image(arquivo)
|
25 |
+
imagem_convertida = Image.open(arquivo)
|
26 |
+
dados_imagem = inferencia.extrair_dados_imagem(
|
27 |
+
"Extraia o nome, cpf, data de nascimento e número de registro. Retorne apenas um JSON com esses dados.",
|
28 |
+
imagem_convertida
|
29 |
+
)
|
30 |
+
print(dados_imagem)
|