(selected, model)
| 118 | |
| 119 | |
| 120 | def on_change_model(selected, model): |
| 121 | size = CKPT_SIZE[selected] |
| 122 | |
| 123 | G = draggan.load_model(utils.get_path(selected), device=device) |
| 124 | model = {'G': G} |
| 125 | W = draggan.generate_W( |
| 126 | G, |
| 127 | seed=int(1), |
| 128 | device=device, |
| 129 | truncation_psi=0.8, |
| 130 | truncation_cutoff=8, |
| 131 | ) |
| 132 | img, _ = draggan.generate_image(W, G, device=device) |
| 133 | |
| 134 | state = { |
| 135 | 'W': W, |
| 136 | 'img': img, |
| 137 | 'history': [] |
| 138 | } |
| 139 | |
| 140 | return model, state, img, img, size |
| 141 | |
| 142 | |
| 143 | def on_new_image(model, seed): |
nothing calls this directly
no outgoing calls
no test coverage detected