Rishie Nandhan commited on
Commit
af234ba
1 Parent(s): 5cf96f5

added gitignore

Browse files
.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # Ignore Mac system files
2
+ .DS_store
3
+ **/.DS_Store
__pycache__/app.cpython-38.pyc ADDED
Binary file (2.39 kB). View file
 
app.py CHANGED
@@ -13,13 +13,14 @@ processor = SamProcessor.from_pretrained("facebook/sam-vit-base")
13
  sidewalk_model = SamModel(config=model_config)
14
  # Update the model by loading the weights from saved file.
15
  print('Status Update: Loading SAM pre-train weights ...')
16
- checkpoint = torch.load("checkpoints/checkpoint_at_epoch_1.pt", map_location=torch.device('mps'))
17
  sidewalk_model.load_state_dict(checkpoint["model"])
18
 
19
  # Set the device
20
- device = "mps" if torch.backends.mps.is_available() else "cpu"
 
21
  sidewalk_model.to(device)
22
- print('Status Update: Using GPU.')
23
 
24
 
25
  def segment_sidewalk(image):
 
13
  sidewalk_model = SamModel(config=model_config)
14
  # Update the model by loading the weights from saved file.
15
  print('Status Update: Loading SAM pre-train weights ...')
16
+ checkpoint = torch.load("checkpoints/checkpoint_at_epoch_1.pt", map_location=torch.device('cpu')) #('mps')
17
  sidewalk_model.load_state_dict(checkpoint["model"])
18
 
19
  # Set the device
20
+ # device = "mps" if torch.backends.mps.is_available() else "cpu"
21
+ device = "cpu"
22
  sidewalk_model.to(device)
23
+ # print('Status Update: Using GPU.')
24
 
25
 
26
  def segment_sidewalk(image):
checkpoints/.DS_Store ADDED
Binary file (6.15 kB). View file
 
checkpoints/checkpoint_at_epoch_1.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18e754a3fd22cd58b1bd2e16d294bd2fc4e449f5879077c8d6a19273e1d66365
3
+ size 406575850
requirements.txt CHANGED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ torch~=2.2.2
2
+ numpy~=1.26.2
3
+ Pillow~=10.1.0