2025-10-11 21:57:26 +03:00
|
|
|
import tensorflow as tf
|
|
|
|
import tensorflow.keras.layers as l
|
|
|
|
from sys import argv
|
|
|
|
|
|
|
|
import f
|
|
|
|
|
|
|
|
m = tf.keras.models.Sequential([
|
|
|
|
l.Input(shape = (784,)),
|
|
|
|
l.Dense(128, activation = "relu"),
|
|
|
|
l.Dense(64, activation = "relu"),
|
|
|
|
l.Dense(10, activation = "softmax")
|
|
|
|
])
|
|
|
|
|
2025-10-11 22:52:07 +03:00
|
|
|
model_label = "1"
|
|
|
|
|
|
|
|
#f.train(m, model_label)
|
|
|
|
f.model_quality(m, model_label)
|
2025-10-11 21:57:26 +03:00
|
|
|
|
|
|
|
if len(argv) == 2:
|
2025-10-11 22:52:07 +03:00
|
|
|
f.classify(m, model_label, argv[1])
|
2025-10-11 21:57:26 +03:00
|
|
|
else:
|
2025-10-11 22:52:07 +03:00
|
|
|
f.classify_live(m, model_label)
|