commit segmentation
This commit is contained in:
parent
605876dfb1
commit
3d03965084
18
0_6_Segmentation.py
Normal file
18
0_6_Segmentation.py
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
import pandas as pd
|
||||||
|
import numpy as np
|
||||||
|
import os
|
||||||
|
import io
|
||||||
|
import s3fs
|
||||||
|
import re
|
||||||
|
import pickle
|
||||||
|
import warnings
|
||||||
|
|
||||||
|
|
||||||
|
exec(open('utils_segmentation.py').read())
|
||||||
|
warnings.filterwarnings('ignore')
|
||||||
|
|
||||||
|
# Load Model
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
model = load_model(type_of_activity, model)
|
20
utils_segmentation.py
Normal file
20
utils_segmentation.py
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
import pandas as pd
|
||||||
|
import numpy as np
|
||||||
|
import os
|
||||||
|
import io
|
||||||
|
import s3fs
|
||||||
|
import re
|
||||||
|
import pickle
|
||||||
|
import warnings
|
||||||
|
|
||||||
|
|
||||||
|
def load_model(type_of_activity, model):
|
||||||
|
BUCKET = f"projet-bdc2324-team1/Output_model/{type_of_activity}/{model}/"
|
||||||
|
filename = model + '.pkl'
|
||||||
|
file_path = BUCKET + filename
|
||||||
|
with fs.open(file_path, mode="rb") as f:
|
||||||
|
model_bytes = f.read()
|
||||||
|
|
||||||
|
model = pickle.loads(model_bytes)
|
||||||
|
return model
|
||||||
|
|
Loading…
Reference in New Issue
Block a user