Skip to content

Commit

Permalink
add checks for sample integrity
Browse files Browse the repository at this point in the history
  • Loading branch information
ngbountos committed Jun 21, 2023
1 parent a925e5d commit 4da286f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
13 changes: 8 additions & 5 deletions dataset/Dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import einops
import torchvision
import albumentations as A

np.random.seed(999)
torch.manual_seed(999)
random.seed(999)
Expand Down Expand Up @@ -257,13 +258,15 @@ def __init__(self, config, mode="train"):
label = 0
else:
label = 1

sample_insar_path = annotation_utils.get_insar_path(
annotation_path=annotation_path + annotation_file,
root_path=self.config["data_path"])
sample_cc_path = sample_insar_path[:-8] + 'cc.png'
if not os.path.isfile(sample_cc_path) or not os.path.isfile(sample_insar_path):
continue
sample_dict = {
"frameID": annotation["frameID"],
"insar_path": annotation_utils.get_insar_path(
annotation_path=annotation_path + annotation_file,
root_path=self.config["data_path"],
),
"insar_path":sample_insar_path,
"label": annotation,
}
self.interferograms.append(sample_dict)
Expand Down
1 change: 0 additions & 1 deletion utilities/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ def load_checkpoint(model, optimizer, args):
def extract_state_dict_from_ddp_checkpoint(checkpoint_path):
print("=> loading checkpoint '{}'".format(checkpoint_path))
checkpoint = torch.load(checkpoint_path, map_location="cpu")
print(checkpoint.keys())
encoder_state_dict = {}
for key in list(checkpoint["state_dict"].keys()):
checkpoint["state_dict"][key.replace("module.", "")] = checkpoint[
Expand Down

0 comments on commit 4da286f

Please sign in to comment.