-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathgen_ds.py
86 lines (79 loc) · 2.71 KB
/
gen_ds.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import os
import errno
import numpy as np
from PIL import Image
import torchvision.datasets as dset
import sys
from copy import deepcopy
import argparse
import math
import torch.utils.data as data
import torch
import torch.nn.init
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torchvision.transforms as transforms
from torch.autograd import Variable
import torch.backends.cudnn as cudnn
from tqdm import tqdm
import random
import cv2
import copy
from Utils import str2bool
from dataset import TripletPhotoTour
root='dataset'
train_loader = torch.utils.data.DataLoader(
TripletPhotoTour(train=True,
batch_size=128,
root=root,
name='notredame',
download=True,
transform=None),
batch_size=128,
shuffle=False)
train_loader = torch.utils.data.DataLoader(
TripletPhotoTour(train=True,
batch_size=128,
root=root,
name='yosemite',
download=True,
transform=None),
batch_size=128,
shuffle=False)
train_loader = torch.utils.data.DataLoader(
TripletPhotoTour(train=True,
batch_size=128,
root=root,
name='liberty',
download=True,
transform=None),
batch_size=128,
shuffle=False)
train_loader = torch.utils.data.DataLoader(
TripletPhotoTour(train=True,
batch_size=128,
root=root,
name='notredame_harris',
download=True,
transform=None),
batch_size=128,
shuffle=False)
train_loader = torch.utils.data.DataLoader(
TripletPhotoTour(train=True,
batch_size=128,
root=root,
name='yosemite_harris',
download=True,
transform=None),
batch_size=128,
shuffle=False)
train_loader = torch.utils.data.DataLoader(
TripletPhotoTour(train=True,
batch_size=128,
root=root,
name='liberty_harris',
download=True,
transform=None),
batch_size=128,
shuffle=False)