-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5650968
commit 11affca
Showing
6 changed files
with
221 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
MODEL: | ||
input_shape : [224, 224, 3] | ||
encodings_len: 256 | ||
mode : 'siamese' | ||
distance_type : 'l1' | ||
backbone_name : 'efficientnet-b3' | ||
backbone_weights : 'noisy-student' | ||
freeze_backbone : False | ||
embeddings_normalization: True | ||
|
||
DATALOADER: | ||
dataset_path : '/home/rauf/datasets/aaaa/deepfake/' | ||
csv_file : | ||
image_id_column : | ||
label_column : | ||
validate : True | ||
val_ratio : 0.2 | ||
|
||
GENERATOR: | ||
batch_size : 5 | ||
n_batches : 5000 | ||
n_batches_val : 500 | ||
augmentations : 'deepfake' | ||
|
||
TRAIN: | ||
# optimizer parameters | ||
optimizer : 'radam' | ||
learning_rate : 0.00016 | ||
decay_factor : 0.95 | ||
step_size : 1 | ||
|
||
# embeddings learning training parameters | ||
n_epochs : 1000 | ||
|
||
# plot training history | ||
plot_history : True | ||
|
||
# SOFTMAX_PRETRAINING: | ||
# # softmax pretraining parameters | ||
# optimizer : 'radam' | ||
# learning_rate : 0.0001 | ||
# decay_factor : 0.99 | ||
# step_size : 1 | ||
|
||
# batch_size : 16 | ||
# val_steps : 200 | ||
# steps_per_epoch : 1000 | ||
# n_epochs : 50 | ||
|
||
SAVE_PATHS: | ||
project_name : 'deepfake_efn_b3' | ||
work_dir : 'work_dirs/' | ||
|
||
ENCODINGS: | ||
# encodings parameters | ||
save_encodings : True | ||
centers_only: False | ||
max_num_samples_of_each_class : 30 | ||
knn_k : 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from tensorflow.keras.models import load_model, Model | ||
import efficientnet.tfkeras as efn | ||
from embedding_net.utils import parse_params | ||
from embedding_net.model_new import SiameseNet | ||
|
||
model_path = '/home/rauf/EmbeddingNet/work_dirs/deepfake_efn_b3/weights/best_deepfake_efn_b3_001_0.578046.hdf5' | ||
cfg_params = parse_params('configs/deepfake_siamese.yml') | ||
|
||
model = SiameseNet(cfg_params, training=True) | ||
model.model.load_weights(model_path, by_name=True) | ||
# model.load_model(model_path) | ||
|
||
model_classification = model.classification_model | ||
model_classification.save("model_classification.h5") |
Oops, something went wrong.