Skip to content
Extraits de code Groupes Projets
Valider 606aec82 rédigé par Victor Joos de ter Beerst's avatar Victor Joos de ter Beerst
Parcourir les fichiers

Create simple version

parent e65619c7
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Affichage de
avec 11 ajouts et 99 suppressions
preprocess:
_target_: flash.core.data.utils.download_data
url: "https://pl-flash-data.s3.amazonaws.com/hymenoptera_data.zip"
path: "./data"
path: "/tmp"
datamodule:
_target_: flash.image.ImageClassificationData.from_folders
......@@ -26,7 +26,10 @@ trainer:
predict_datamodule:
_target_: flash.image.ImageClassificationData.from_files
predict_files:
- "data/hymenoptera_data/val/bees/65038344_52a45d090d.jpg"
- "data/hymenoptera_data/val/bees/590318879_68cf112861.jpg"
- "data/hymenoptera_data/val/ants/540543309_ddbb193ee5.jpg"
- "${preprocess.path}/hymenoptera_data/val/bees/65038344_52a45d090d.jpg"
- "${preprocess.path}/hymenoptera_data/val/bees/590318879_68cf112861.jpg"
- "${preprocess.path}/hymenoptera_data/val/ants/540543309_ddbb193ee5.jpg"
batch_size: 3
show: true
save: false
_target_: flash.image.SemanticSegmentationData.from_folders
train_folder: "${preprocess.path}/CameraRGB"
train_target_folder: "${preprocess.path}/CameraSeg"
val_split: 0.1
transform_kwargs:
image_size: [256, 256]
num_classes: 21
batch_size: 4
_target_: flash.image.SemanticSegmentationData.from_files
predict_files:
- "${preprocess.path}/CameraRGB/F61-1.png"
- "${preprocess.path}/CameraRGB/F62-1.png"
- "${preprocess.path}/CameraRGB/F63-1.png"
batch_size: 3
_target_: flash.image.ImageClassificationData.from_csv
input_field: "Id"
target_fields: ["Action", "Romance", "Crime", "Thriller", "Adventure"]
train_file: ${preprocess.path}/movie_posters/train/metadata.csv
train_resolver:
_target_: hydra_flash.utils.resolver
_partial_: true
val_file: ${preprocess.path}/movie_posters/val/metadata.csv
val_resolver:
_target_: hydra_flash.utils.resolver
_partial_: true
transform_kwargs:
image_size: [128, 128]
batch_size: 1
_target_: flash.image.ImageClassificationData.from_files
predict_files:
- "${preprocess.path}/movie_posters/predict/tt0085318.jpg"
- "${preprocess.path}/movie_posters/predict/tt0089461.jpg"
- "${preprocess.path}/movie_posters/predict/tt0097179.jpg"
batch_size: 3
# @package _global_
defaults:
- _self_
- /preprocess: hymenoptera
- /datamodule: hymenoptera
- /model: resnet18
- /datamodule@predict_datamodule: hymenoptera_test
- /server: local
trainer:
_target_: flash.Trainer
max_epochs: 3
gpus: 1
# @package _global_
defaults:
- _self_
- /preprocess: lyft
- /datamodule: lyft
- /model: seg_mobilenet
- /datamodule@predict_datamodule: lyft_test
- /server: local
trainer:
_target_: flash.Trainer
max_epochs: 3
gpus: 1
# @package _global_
defaults:
- _self_
- /preprocess: movie_poster
- /datamodule: movie_posters
- /model: resnet18
- /datamodule@predict_datamodule: movie_posters_test
- /server: local
trainer:
_target_: flash.Trainer
max_epochs: 3
gpus: 1
_target_: flash.image.ImageClassifier
backbone: resnet18
learning_rate: 1.e-3
complete:
- labels
- multi_label
_target_: flash.image.SemanticSegmentation
backbone: "mobilenetv3_large_100"
head: fpn
num_classes: ${datamodule.num_classes}
complete: []
defaults:
- download
url: "https://github.com/ongchinkiat/LyftPerceptionChallenge/releases/download/v0.1/carla-capture-20180513A.zip"
defaults:
- download
url: "https://pl-flash-data.s3.amazonaws.com/movie_posters.zip"
......@@ -11,7 +11,7 @@ log = logging.getLogger(__name__)
instantiate = partial(hydra_instantiate, _convert_="all")
@hydra.main(version_base="1.1", config_path="conf", config_name="config")
@hydra.main(version_base="1.1", config_path="conf", config_name="config2")
def main(cfg):
# Preprocess : download and/or unzip data
call(cfg.preprocess)
......@@ -20,11 +20,9 @@ def main(cfg):
datamodule = instantiate(cfg.datamodule)
# Create model
model_kwargs = {}
for kw in cfg.model.complete:
model_kwargs[kw] = getattr(datamodule, kw)
del cfg.model.complete
model = instantiate(cfg.model, **model_kwargs)
model = instantiate(
cfg.model, labels=datamodule.labels, multi_label=datamodule.multi_label
)
# Finetune model
trainer = instantiate(cfg.trainer)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter