Skip to content

Commit

Permalink
updated README and python requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
Aman Chadha authored and Aman Chadha committed Dec 2, 2019
1 parent d9e81f8 commit bd7a22a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions AFRVSRTrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ def printCUDAStats():
optimizerG = optim.Adam(netG.parameters(), lr=lr)
optimizerD = optim.Adam(netD.parameters(), lr=lr)

results = {'DLoss': [], 'GLoss': [], 'DScore': [], 'GScore': [], 'PSNR': [], 'SSIM': []}

def trainModel(epoch):
trainBar = tqdm(trainLoader)
runningResults = {'batchSize': 0, 'DLoss': 0, 'GLoss': 0, 'DScore': 0, 'GScore': 0}
Expand Down Expand Up @@ -199,6 +197,8 @@ def validateModel():
return validationResults

def saveModelParams(epoch, runningResults, validationResults={}):
results = {'DLoss': [], 'GLoss': [], 'DScore': [], 'GScore': [], 'PSNR': [], 'SSIM': []}

# Save model parameters
torch.save(netG.state_dict(), 'epochs/netG_epoch_%d_%d.pth' % (UPSCALE_FACTOR, epoch))
torch.save(netD.state_dict(), 'epochs/netD_epoch_%d_%d.pth' % (UPSCALE_FACTOR, epoch))
Expand Down
2 changes: 1 addition & 1 deletion DatasetLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def get_from_set(dir, frame_set):
file_dir_frames = os.path.join(dir, frames)
imgs_path = os.listdir(file_dir_frames)
imgs_path.sort()
#import pdb; pdb.set_trace()

i = 0
for img in imgs_path:
final_path = file_dir_frames + "/" + img
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ Project for Stanford CS230: Deep Learning
## Required Packages

```
pytorch
numpy
scikit-image
opencv-python
tqdm
torch==1.3.0.post2
pytorch-ssim==0.1
numpy==1.16.4
opencv-python==4.1.1.26
scikit-image==0.15.0
tqdm==4.37.0
```

To load,
Expand Down Expand Up @@ -55,7 +56,7 @@ Train the model using (takes roughly an hour per epoch on an NVIDIA Tesla V100):

To use the pre-trained model and test on a random video from within the dataset:

```python AFRVSRTest.py`````
```python AFRVSRTest.py```

## Acknowledgements

Expand Down
11 changes: 6 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
pytorch
numpy
scikit-image
opencv-python
tqdm
torch==1.3.0.post2
pytorch-ssim==0.1
numpy==1.16.4
opencv-python==4.1.1.26
scikit-image==0.15.0
tqdm==4.37.0

0 comments on commit bd7a22a

Please sign in to comment.