-
Notifications
You must be signed in to change notification settings - Fork 1
Release/rc0.1 #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Release/rc0.1 #15
Conversation
…mall refactoring of project files
…g' into release/rc0.1
…-refactoring' into release/rc0.1
mrTahion
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вроде местами не хватает запуска linter.sh
| DATA: | ||
| FEAT_EMB: | ||
| PATH: "data/CUB/resnet101/" | ||
| PATH: "datasets/CUB/resnet101/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Все ещё сомневаюсь насчет этого переименования
| ZeroShotEval is provided with 2 build-in datasest: | ||
| - AWA2 | ||
| - CUB No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Что мешает использовать, например, SUN?
| Please note, that this script is designed for CUB, SUN, AWA1, AWA2 | ||
| datasets only, and moreover these datasets must be downloaded from: | ||
| https://www.dropbox.com/sh/btoc495ytfbnbat/AAAaurkoKnnk0uV-swgF-gdSa?dl=0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Please note, that this script is designed for CUB, SUN, AWA1, AWA2 | |
| datasets only, and moreover these datasets must be downloaded from: | |
| https://www.dropbox.com/sh/btoc495ytfbnbat/AAAaurkoKnnk0uV-swgF-gdSa?dl=0 | |
| Please note, that this script is designed for CUB, SUN, AWA1, AWA2 | |
| .. _datasets: | |
| https://www.dropbox.com/sh/btoc495ytfbnbat/AAAaurkoKnnk0uV-swgF-gdSa?dl=0 |
| # NOTE: there are two more fields in mat files that are not in use now, but can be used | ||
| # train_loc = mat_data['train_loc'].squeeze() - 1 #--> train_feature = TRAIN SEEN | ||
| # val_unseen_loc = mat_data['val_loc'].squeeze() - 1 #--> test_unseen_feature = TEST UNSEEN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Может стоит удалить?
tools/single_experiment.py
Outdated
| from zeroshoteval.utils.parser import load_config, parse_args | ||
| from zeroshoteval.zeroshotnets.build import build_zsl | ||
|
|
||
| os.chdir("../") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Для чего эта строка?
| import torch | ||
| from fvcore.common.config import CfgNode | ||
| from torch.utils.data.dataloader import DataLoader |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| import torch | |
| from fvcore.common.config import CfgNode | |
| from torch.utils.data.dataloader import DataLoader | |
| from fvcore.common.config import CfgNode | |
| from torch.utils.data.dataloader import DataLoader |
| loader = torch.utils.data.DataLoader( | ||
| dataset, | ||
| batch_size=cfg.ZSL.BATCH_SIZE, | ||
| num_workers=cfg.DATA_LOADER.NUM_WORKERS, | ||
| pin_memory=cfg.DATA_LOADER.PIN_MEMORY, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| loader = torch.utils.data.DataLoader( | |
| dataset, | |
| batch_size=cfg.ZSL.BATCH_SIZE, | |
| num_workers=cfg.DATA_LOADER.NUM_WORKERS, | |
| pin_memory=cfg.DATA_LOADER.PIN_MEMORY, | |
| ) | |
| loader = DataLoader( | |
| dataset, | |
| batch_size=cfg.ZSL.BATCH_SIZE, | |
| num_workers=cfg.DATA_LOADER.NUM_WORKERS, | |
| pin_memory=cfg.DATA_LOADER.PIN_MEMORY, | |
| ) |
| Args: | ||
| idx: Index of sample to return. | ||
| Returns: Tuple2 with dictionary of `modalities names: item from each modality` and `sample label` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Returns: Tuple2 with dictionary of `modalities names: item from each modality` and `sample label` | |
| Returns: | |
| sample_data ... | |
| sample_label ... |
| return len(self.labels) | ||
|
|
||
| def __getitem__(self, idx): | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docstring?
| self._data_loader_iter = iter(data_loader) | ||
|
|
||
| def evaluate(self) -> None: | ||
| logger = logging.getLogger(__name__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
мб вынести наружу?
| return args | ||
|
|
||
|
|
||
| def read_data(images_mat_file: str, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
может более понятнее будет название read_data_mat или что-то похожее?
tools/single_experiment.py
Outdated
| # -------------------------------------------------------------------------- | ||
|
|
||
| # TODO: extract gen_synthetic_data from CADA-VAE and move it to inference section | ||
| pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В этом ПР пока отказываемся от идеи вынести емб экстрактор из тренировки?
| from zeroshoteval.utils.exceptions import ExtractorTypeError | ||
|
|
||
|
|
||
| class ImageEmbeddingExtractor(EmbeddingExtractor): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это окончательная версия экстрактора или будет переделываться?
|
|
||
|
|
||
| class DecoderTemplate(nn.Module): | ||
| """Decoder part for CADA-VAE model. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Может в докстринге написать что это просто декодер, так как и лизгане по сути такойже декодер?
| self.labels = None | ||
|
|
||
| assert split in ["trainval", "test", "test_unseen"] | ||
| assert mod in ["CLS_ATTR", "IMG"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
разве везде не изменили CLS_ATTR на CLSATTR?
zeroshoteval/config/defaults.py
Outdated
| _C.ZSL.EPOCH = 100 | ||
| # _C.ZSL.EPOCH = 100 | ||
| _C.ZSL.EPOCH = 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Для чего это изменение? В любом случае не стоит, кмк, оставлять закоменченные строки.
| train_loader = construct_loader(cfg, split="train") | ||
| test_loader = construct_loader(cfg, split="test") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Кмк train_loader и test_loader в инференсе совсем неочевидные названия.
Massive changes in folders structure, main classes, call logic, input/output data formats.
Therefore, please make a full review of the entire project.
In case of any questions please contact me @nikolaev-n