(model, seed)
| 140 | |
| 141 | |
| 142 | def on_new_image(model, seed): |
| 143 | G = model['G'] |
| 144 | W = draggan.generate_W( |
| 145 | G, |
| 146 | seed=int(seed), |
| 147 | device=device, |
| 148 | truncation_psi=0.8, |
| 149 | truncation_cutoff=8, |
| 150 | ) |
| 151 | img, _ = draggan.generate_image(W, G, device=device) |
| 152 | |
| 153 | state = { |
| 154 | 'W': W, |
| 155 | 'img': img, |
| 156 | 'history': [] |
| 157 | } |
| 158 | |
| 159 | points = {'target': [], 'handle': []} |
| 160 | target_point = False |
| 161 | return img, img, state, points, target_point |
| 162 | |
| 163 | |
| 164 | def on_max_iter_change(max_iters): |
nothing calls this directly
no outgoing calls
no test coverage detected