callum-canavan commited on
Commit
785096a
1 Parent(s): 4a0748c

Update interface

Browse files
Files changed (2) hide show
  1. app.py +2 -2
  2. visual_anagrams/views/__init__.py +1 -4
app.py CHANGED
@@ -42,7 +42,7 @@ def generate_content(
42
  views = ['identity', VIEW_MAP_NAMES[transformation]]
43
  views = get_views(views)
44
 
45
- generator = torch.manual_seed(seed)
46
 
47
  print("Sample stage 1")
48
  image = sample_stage_1(stage_1,
@@ -86,7 +86,7 @@ gradio_app = gr.Interface(
86
  gr.Textbox(label="Prompt for original view", placeholder="a dress"),
87
  gr.Textbox(label="Prompt for transformed view", placeholder="an old man"),
88
  gr.Dropdown(label="View transformation", choices=choices, value=choices[0]),
89
- gr.Number(label="Number of diffusion steps", value=30, step=1, minimum=1, maximum=300),
90
  gr.Number(label="Random seed", value=0, step=1, minimum=0, maximum=100000),
91
  ],
92
  outputs=[gr.Video(label="Illusion"), gr.Image(label="Before and After")],
 
42
  views = ['identity', VIEW_MAP_NAMES[transformation]]
43
  views = get_views(views)
44
 
45
+ generator = torch.manual_seed(seed + 42)
46
 
47
  print("Sample stage 1")
48
  image = sample_stage_1(stage_1,
 
86
  gr.Textbox(label="Prompt for original view", placeholder="a dress"),
87
  gr.Textbox(label="Prompt for transformed view", placeholder="an old man"),
88
  gr.Dropdown(label="View transformation", choices=choices, value=choices[0]),
89
+ gr.Number(label="Number of diffusion steps", value=50, step=1, minimum=1, maximum=300),
90
  gr.Number(label="Random seed", value=0, step=1, minimum=0, maximum=100000),
91
  ],
92
  outputs=[gr.Video(label="Illusion"), gr.Image(label="Before and After")],
visual_anagrams/views/__init__.py CHANGED
@@ -27,12 +27,9 @@ VIEW_MAP = {
27
 
28
  VIEW_MAP_NAMES = {
29
  'Flip': 'flip',
30
- 'Rotate 90° clockwise': 'rotate_cw',
31
- 'Rotate 90° counter-clockwise': 'rotate_ccw',
32
  'Invert colors': 'negate',
33
  'Shear': 'skew',
34
- 'Patch permutation': 'patch_permute',
35
- 'Pixel permutation': 'pixel_permute',
36
  'Jigsaw permutation': 'jigsaw',
37
  'Rotate inner circle': 'inner_circle',
38
  }
 
27
 
28
  VIEW_MAP_NAMES = {
29
  'Flip': 'flip',
30
+ 'Rotate 90°': 'rotate_cw',
 
31
  'Invert colors': 'negate',
32
  'Shear': 'skew',
 
 
33
  'Jigsaw permutation': 'jigsaw',
34
  'Rotate inner circle': 'inner_circle',
35
  }