Skip to content

Commit

Permalink
update huggingface app to use the new models
Browse files Browse the repository at this point in the history
  • Loading branch information
GreenWizard2015 committed Apr 7, 2024
1 parent 06c25bf commit 54ab164
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
3 changes: 2 additions & 1 deletion configs/experiments/diffusion/ddim.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"restorator": {
"sampler": {
"name": "DDIM",
"stochasticity": 0.0,
"stochasticity": 1.0,
"project noise": true,
"steps skip type": {
"name": "uniform",
"K": 5
Expand Down
35 changes: 16 additions & 19 deletions huggingface/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,36 +35,33 @@ def run2inference(run, runName=None):
runConfig['huggingface'] = { "name": runName, "wandb": run.fullId }
return list(inference_from_config(runConfig))

def SPModels(project):
bestPerGroup = project.groups(onlyBest=True)
bestPerGroup = {k: v for k, v in bestPerGroup.items() if k.startswith('Single-pass | ')}
for run in bestPerGroup.values():
for model in run2inference(run):
yield model
continue
return

def main(args):
WBProject = CWBProject('green_wizard/FranNet')
folder = os.path.dirname(os.path.abspath(__file__))
# load list of models from the folder "configs"
models = modelsFrom(os.path.join(folder, 'configs'))
# add some models from W&B
models.extend( list(SPModels(WBProject)) )
models = []
bestGroups = WBProject.groups(onlyBest=True)
customRuns = [
'DDPM v2 | Basic',
# some of "DDPM-V, encoder v2, masking-8, residual"
'DDPM-V, encoder v2, masking-8, residual, RGB',
'DDPM-V, encoder v2, masking-8, residual, LAB',
'DDPM-V, encoder v2, masking-8, residual, LAB, structured',
# autorregressive direction
'Single-pass | Basic+masking-8',
'Single-pass | Basic+masking-uniform',
'Single-pass | Basic+masking-dynamic',
'Single-pass | Basic',
'Single-pass | Basic+masking-4',
'Single-pass | Basic+masking-32',
'Single-pass | Basic+masking-16',
'AR | direction',
'AR direction, encoder v2, masking-8, residual, LAB, structured',
'AR direction, masking-8, RGB, extra(grayscale), structured',

'DDPM-V, encoder v2, residual, RGB, extra(grayscale), structured, T-start',
'DDPM-V, encoder v2, residual, RGB, extra(grayscale), structured, huge',
'Single-pass | Basic+masking-16, encoder v2, huber, RGB, residual, extra(grayscale), structured',
'Huge++',
'DDPM-V | ONLY SR | huber, RGB, residual, extra(grayscale), structured, T start',
'DDPM-V | ONLY SR | encoder v2, huber, RGB, residual, extra(grayscale), structured, T start',
'AR direction | ONLY SR | masking-16, encoder v2, huber, RGB, residual, extra(grayscale), structured',
'Single-pass | ONLY SR | Basic+masking-16, encoder v2, huber, RGB, residual, extra(grayscale), structured',
'huge++, only SR',
'Huge++'
]
for runName in customRuns:
models.extend( run2inference(bestGroups[runName]) )
Expand Down

0 comments on commit 54ab164

Please sign in to comment.