-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.jl
More file actions
25 lines (20 loc) · 685 Bytes
/
main.jl
File metadata and controls
25 lines (20 loc) · 685 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using SinGAN
using FileIO
using Flux
function main()
# hp = HyperParams()
hp = load_hyperparams("hyperparams.json")
# save_hyperparams("hyperparams.json", hp)
dscrp, genp = setup_models(hp)
@info dscrp
@info genp
img_name = "floral_shoppe.jpg"
orig_rgb_img = load(img_name)
orig_img = SinGAN.rgb_to_array(orig_rgb_img) |> gpu
img_shapes = image_shapes(hp)
real_img_p = SinGAN.build_image_pyramid(orig_img, img_shapes, img_shapes)
# load_model_params!(dscrp, genp, Base.length(img_shapes))
amplifiers, z_rec = train!(dscrp, genp, real_img_p, hp)
generate_animation(genp, 0.1f0, 0.9f0, first(amplifiers), z_rec)
end
main()