Rdad commited on
Commit
c69b4d1
โ€ข
1 Parent(s): d5d8f36

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -15,27 +15,27 @@ import os
15
  #zip_ref.extractall('FINAL-EFFICIENTNETV2-B0')
16
  #zip_ref.close()
17
 
18
- import h5py
19
 
20
  # ุงูุชุญ ู…ู„ู ุงู„ู†ู…ูˆุฐุฌ H5
21
- h5_file = h5py.File('model_cp.h5', 'r')
22
 
23
  # ู‚ุฑุงุกุฉ ุงู„ู…ุญุชูˆู‰
24
  # ูŠู…ูƒู†ูƒ ุงุณุชูƒุดุงู ุงู„ู…ุญุชูˆู‰ ุจุงุณุชุฎุฏุงู… ุงู„ุฃูˆุงู…ุฑ ุงู„ุชุงู„ูŠุฉ
25
- print(h5_file.keys()) # ู‚ุงุฆู…ุฉ ุงู„ู…ูุงุชูŠุญ ููŠ ุงู„ู…ู„ู
26
- print(h5_file['model_weights'].keys()) # ู‚ุงุฆู…ุฉ ุงู„ู…ูุงุชูŠุญ ููŠ ู…ุฌู…ูˆุนุฉ ุงู„ุฃูˆุฒุงู†
27
 
28
  # ุฅู†ุดุงุก ู…ู„ู HDF5 ุฌุฏูŠุฏ
29
- hdf5_file = h5py.File('model.hdf5', 'w')
30
 
31
  # ู†ุณุฎ ุงู„ู…ุญุชูˆู‰ ู…ู† ู…ู„ู ุงู„ู†ู…ูˆุฐุฌ H5 ุฅู„ู‰ ุงู„ู…ู„ู ุงู„ุฌุฏูŠุฏ
32
- h5_file.copy('model_weights', hdf5_file)
33
 
34
  # ุฅุบู„ุงู‚ ุงู„ู…ู„ูุงุช
35
- h5_file.close()
36
- hdf5_file.close()
37
 
38
- model = tf.keras.models.load_model('model.hdf5')
39
 
40
  detector = MTCNN()
41
 
 
15
  #zip_ref.extractall('FINAL-EFFICIENTNETV2-B0')
16
  #zip_ref.close()
17
 
18
+ #import h5py
19
 
20
  # ุงูุชุญ ู…ู„ู ุงู„ู†ู…ูˆุฐุฌ H5
21
+ #h5_file = h5py.File('model_cp.h5', 'r')
22
 
23
  # ู‚ุฑุงุกุฉ ุงู„ู…ุญุชูˆู‰
24
  # ูŠู…ูƒู†ูƒ ุงุณุชูƒุดุงู ุงู„ู…ุญุชูˆู‰ ุจุงุณุชุฎุฏุงู… ุงู„ุฃูˆุงู…ุฑ ุงู„ุชุงู„ูŠุฉ
25
+ #print(h5_file.keys()) # ู‚ุงุฆู…ุฉ ุงู„ู…ูุงุชูŠุญ ููŠ ุงู„ู…ู„ู
26
+ #print(h5_file['tf_lite_model.tflite'].keys()) # ู‚ุงุฆู…ุฉ ุงู„ู…ูุงุชูŠุญ ููŠ ู…ุฌู…ูˆุนุฉ ุงู„ุฃูˆุฒุงู†
27
 
28
  # ุฅู†ุดุงุก ู…ู„ู HDF5 ุฌุฏูŠุฏ
29
+ #hdf5_file = h5py.File('model.hdf5', 'w')
30
 
31
  # ู†ุณุฎ ุงู„ู…ุญุชูˆู‰ ู…ู† ู…ู„ู ุงู„ู†ู…ูˆุฐุฌ H5 ุฅู„ู‰ ุงู„ู…ู„ู ุงู„ุฌุฏูŠุฏ
32
+ #h5_file.copy('model_weights', hdf5_file)
33
 
34
  # ุฅุบู„ุงู‚ ุงู„ู…ู„ูุงุช
35
+ #h5_file.close()
36
+ #hdf5_file.close()
37
 
38
+ model = tf.keras.models.load_model('tf_lite_model.tflite')
39
 
40
  detector = MTCNN()
41