Overglitch commited on
Commit
2c28979
·
verified ·
1 Parent(s): e838d9e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -36,7 +36,6 @@ def predict_fingerprint(image):
36
  def preprocess_image(image):
37
  # Guardar la imagen en formato TIFF
38
  image.save("temp_image.tiff")
39
- image.resize((256,256))
40
  processed_image = representativo("temp_image.tiff")
41
  processed_image_resized = processed_image.reshape(1, -1)
42
  return processed_image_resized
@@ -50,7 +49,9 @@ def get_fingerprint_type(winner):
50
  async def predict_fingerprint_api(file: UploadFile = File(...)):
51
  try:
52
  contents = await file.read()
 
53
  image = Image.open(BytesIO(contents)).convert('L')
 
54
  fingerprint_type = predict_fingerprint(image)
55
  return {"prediction": fingerprint_type}
56
  except Exception as e:
@@ -93,7 +94,7 @@ def orientacion(patron, w):
93
  return mOrientaciones
94
 
95
  def representativo(archivo):
96
- im = Image.open(archivo).convert('L')
97
  m, n = im.size
98
  imarray = np.array(im, np.float32)
99
  patron = imarray[1:m-1, 1:n-1]
 
36
  def preprocess_image(image):
37
  # Guardar la imagen en formato TIFF
38
  image.save("temp_image.tiff")
 
39
  processed_image = representativo("temp_image.tiff")
40
  processed_image_resized = processed_image.reshape(1, -1)
41
  return processed_image_resized
 
49
  async def predict_fingerprint_api(file: UploadFile = File(...)):
50
  try:
51
  contents = await file.read()
52
+ print("CONTENTS\N\N", contents)
53
  image = Image.open(BytesIO(contents)).convert('L')
54
+ print("IMAGEN\N\N", image)
55
  fingerprint_type = predict_fingerprint(image)
56
  return {"prediction": fingerprint_type}
57
  except Exception as e:
 
94
  return mOrientaciones
95
 
96
  def representativo(archivo):
97
+ im = Image.open(archivo)
98
  m, n = im.size
99
  imarray = np.array(im, np.float32)
100
  patron = imarray[1:m-1, 1:n-1]