carlosabadia commited on
Commit
9e459c7
·
1 Parent(s): e98a15b
__pycache__/solver.cpython-310.pyc ADDED
Binary file (6.01 kB). View file
 
app.py CHANGED
@@ -62,14 +62,14 @@ def main():
62
  input_board = gr.Image(label='Board',
63
  type='filepath',
64
  interactive=True,
65
- placeholder="examples/board_test.png")
66
  with gr.Row():
67
  crop_board_button = gr.Button('Crop Board ✂️')
68
  with gr.Row():
69
  input_words = gr.Image(label='Words',
70
  type='filepath',
71
  interactive=True, height="300px", width="300px",
72
- placeholder="examples/words_test.png")
73
  with gr.Row():
74
  crop_words_button = gr.Button('Crop Words ✂️')
75
  with gr.Row():
 
62
  input_board = gr.Image(label='Board',
63
  type='filepath',
64
  interactive=True,
65
+ )
66
  with gr.Row():
67
  crop_board_button = gr.Button('Crop Board ✂️')
68
  with gr.Row():
69
  input_words = gr.Image(label='Words',
70
  type='filepath',
71
  interactive=True, height="300px", width="300px",
72
+ )
73
  with gr.Row():
74
  crop_words_button = gr.Button('Crop Words ✂️')
75
  with gr.Row():
output/Tablero_solucion.png ADDED
solver.py CHANGED
@@ -19,7 +19,7 @@ with open("class_names.txt", "r") as f: # reading them in from class_names.txt
19
 
20
  model1 = tf.keras.models.load_model('model/model30.h5')
21
  model2 = tf.keras.models.load_model('model/model15.h5')
22
- model3 = tf.keras.models.load_model('model/model2.h5')
23
 
24
  palabras_1 = []
25
  # Borrar el directorio de imagenes
@@ -177,18 +177,12 @@ def solve_puzzle(img, words):
177
  img_array = img2.reshape(1, 28, 28, 1)
178
  prediction1 = np.argmax(model1.predict(img_array))
179
  prediction2 = np.argmax(model2.predict(img_array))
180
- prediction3 = np.argmax(model3.predict(img_array))
181
  pred = 0
182
- if prediction1 == prediction2 and prediction2 == prediction3:
183
  pred = prediction1
184
- elif prediction1 == prediction2:
185
- pred = prediction1
186
- elif prediction2 == prediction3:
187
- pred = prediction2
188
- elif prediction1 == prediction3:
189
- pred = prediction3
190
  else:
191
- pred = 32
192
  #print(characters[pred])
193
  contCuadrados["anchura"] = x
194
  contCuadrados["altura"] = y
 
19
 
20
  model1 = tf.keras.models.load_model('model/model30.h5')
21
  model2 = tf.keras.models.load_model('model/model15.h5')
22
+ #model3 = tf.keras.models.load_model('model/model2.h5')
23
 
24
  palabras_1 = []
25
  # Borrar el directorio de imagenes
 
177
  img_array = img2.reshape(1, 28, 28, 1)
178
  prediction1 = np.argmax(model1.predict(img_array))
179
  prediction2 = np.argmax(model2.predict(img_array))
180
+ #prediction3 = np.argmax(model3.predict(img_array))
181
  pred = 0
182
+ if prediction1 == prediction2:
183
  pred = prediction1
 
 
 
 
 
 
184
  else:
185
+ pred = 32
186
  #print(characters[pred])
187
  contCuadrados["anchura"] = x
188
  contCuadrados["altura"] = y
wordsPuzzle/ALDRIN.jpg ADDED
wordsPuzzle/BARNEY.jpg ADDED
wordsPuzzle/LAWYER.jpg ADDED
wordsPuzzle/LILY.jpg ADDED
wordsPuzzle/MANHATTAN.jpg ADDED
wordsPuzzle/MARSHALL.jpg ADDED
wordsPuzzle/MOSBY.jpg ADDED
wordsPuzzle/PRESENTER.jpg ADDED
wordsPuzzle/SCHERBATSKY.jpg ADDED
wordsPuzzle/TEACHER.jpg ADDED
wordsPuzzle/TED.jpg ADDED