Chancee12 commited on
Commit
02ca2fd
·
1 Parent(s): 5eb4896

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -16,11 +16,18 @@ from keras import backend as K
16
  from keras.models import load_model
17
 
18
  # Replace 'your_username' and 'your_model_name' with the appropriate values
 
 
19
  model_identifier = "Chancee12/satellite_segmentation_v3_full"
20
- model_directory = hf_hub_download(repo_id=model_identifier, repo_type="model")
21
- satellite_model = tf.keras.models.load_model(model_directory, custom_objects=({'dice_loss_plus_1focal_loss' : total_loss, 'jaccard_coef': jaccard_coef}))
 
 
 
 
 
22
 
23
- # The rest of your code remains the same
24
 
25
  class_building = '#2A2A2A'
26
  class_building = class_building.lstrip('#')
 
16
  from keras.models import load_model
17
 
18
  # Replace 'your_username' and 'your_model_name' with the appropriate values
19
+ import zipfile
20
+
21
  model_identifier = "Chancee12/satellite_segmentation_v3_full"
22
+ filename = "satellite_segmentation_v3_full.zip"
23
+ model_directory = hf_hub_download(repo_id=model_identifier, filename=filename, repo_type="model")
24
+
25
+ # Extract the zip file
26
+ with zipfile.ZipFile(model_directory, 'r') as zip_ref:
27
+ zip_ref.extractall("satellite_segmentation_v3_full")
28
+
29
 
30
+ # The rest of code remains the same
31
 
32
  class_building = '#2A2A2A'
33
  class_building = class_building.lstrip('#')