Spaces:
Runtime error
Runtime error
Download KAIR/models/model_plain2.py from lambda/LambdaSuperRes: direct link, hf CLI and curl.
- Browser
- Download file 647 Bytes
-
https://huggingface.co/spaces/lambda/LambdaSuperRes/resolve/main/KAIR/models/model_plain2.py
- Command line
-
hf download hf://spaces/lambda/LambdaSuperRes/KAIR/models/model_plain2.py
-
curl -L -o model_plain2.py https://huggingface.co/spaces/lambda/LambdaSuperRes/resolve/main/KAIR/models/model_plain2.py
647 Bytes
| from models.model_plain import ModelPlain | |
| class ModelPlain2(ModelPlain): | |
| """Train with two inputs (L, C) and with pixel loss""" | |
| # ---------------------------------------- | |
| # feed L/H data | |
| # ---------------------------------------- | |
| def feed_data(self, data, need_H=True): | |
| self.L = data['L'].to(self.device) | |
| self.C = data['C'].to(self.device) | |
| if need_H: | |
| self.H = data['H'].to(self.device) | |
| # ---------------------------------------- | |
| # feed (L, C) to netG and get E | |
| # ---------------------------------------- | |
| def netG_forward(self): | |
| self.E = self.netG(self.L, self.C) | |