Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Commit

Permalink
Fix: check path exists when save model
Browse files Browse the repository at this point in the history
  • Loading branch information
asheswook committed Mar 6, 2023
1 parent 08592ae commit e6947f0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions VisageSnap/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ def _load_model(self) -> LabelPropagation:
return self.model

def _save_model(self) -> None:
if not os.path.exists(os.path.join(os.getcwd(), "model")):
os.mkdir(os.path.join(os.getcwd(), "model"))

data = (self.model, self.faces)
with open(self.model_dir, "wb") as f:
pickle.dump(data, f)
Expand Down

0 comments on commit e6947f0

Please sign in to comment.