mirror of
https://github.com/deepinsight/insightface.git
synced 2025-12-30 08:02:27 +00:00
Using with stmt
This commit is contained in:
@@ -48,9 +48,8 @@ def init_weights(model):
|
||||
m.bias.data.zero_()
|
||||
|
||||
def save_pickle(data, save_path):
|
||||
f = open(save_path, "wb")
|
||||
pkl.dump(data, f)
|
||||
f.close()
|
||||
with open(save_path, "wb") as f:
|
||||
pkl.dump(data, f)
|
||||
print(f"=> saved to {save_path}")
|
||||
|
||||
def load_pickle(load_path):
|
||||
|
||||
Reference in New Issue
Block a user