-
Notifications
You must be signed in to change notification settings - Fork 1
Add a denoising benchmark #1
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: main
Are you sure you want to change the base?
Conversation
| Abstract base class for benchmarks | ||
|
|
||
| All of the benchmarks should inherit this class and implement the `run` method. | ||
| """ |
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.
we should have dataset, metrics in the init here
| :param dinv.models.Denoiser | dinv.models.Reconstructor model: The model to benchmark | ||
| :param torch.device | str device: The device to run the benchmark on (default: `"cpu"`) | ||
| :return: (`Any`) The result of the benchmark | ||
| """ |
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.
we could write the function here with deepinv.test and avoid re-writing the for-loop for each benchmark
| import benchmarks | ||
|
|
||
|
|
||
| class DenoisingBenchmark(benchmarks.Benchmark): |
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.
not sure we need to redefine a new class,
why not something like
Benchmark(dataset=dinv.datasets.Urban100HR("data/Urban100", download=True, transform=transforms.ToTensor()), device=device, )
| for model in models: | ||
| model_name = type(model).__name__ | ||
| psnr_avg, psnr_std = benchmark.run(model, device=device) | ||
| rows.append( |
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.
we could move this logic to the base class since all benchmarks will use this
| @@ -0,0 +1 @@ | |||
| from .benchmark import Benchmark | |||
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.
🤔🤔could we have a config driven interface? :P
No description provided.