Skip to content

Commit 04429c5

Browse files
author
Andrey Ryabtsev
committed
minor formatting error + incorrect use of args
1 parent 40a0cc8 commit 04429c5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

REAMDE_train.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ Cheers to the [unofficial Deep Image Matting repo.](https://github.com/foamliu/D
3737
[Please download our captured videos.](https://drive.google.com/drive/folders/1j3BMrRFhFpfzJAe6P2WDtfanoeSCLPiq?usp=sharing). We will show next how to finetune your model on `fixed-camera` captured videos. It will be similar for `hand-held` cameras, except you will need to align the captured background image to each frame of the video separately. (Take a hint from `test_pre_process.py` and use `alignImages()`.)
3838

3939
Data Pre-processing:
40-
- Extract frames for each video: `ffmpeg -i $NAME.mp4 $NAME/%04d_img.png -hide_banner`
41-
- Run Segmentation (follow instructions on Deeplabv3+) : `python test_segmentation_deeplab.py -i $NAME`
42-
- Target background for composition. For self-supervised learning we need some target backgrounds that has roughly similar lighting as the original videos. Either capture few videos of indoor/outdoor scenes without humans or use our captured background in the `background` folder.
43-
- Create a .csv file `Video_data_train.csv` with each row as: `$image;$captured_back;$segmentation;$image+20frames;$image+2*20frames;$image+3*20frames;$image+4*20frames;$target_back`.
40+
- Extract frames for each video: `ffmpeg -i $NAME.mp4 $NAME/%04d_img.png -hide_banner`
41+
- Run Segmentation (follow instructions on Deeplabv3+) : `python test_segmentation_deeplab.py -i $NAME`
42+
- Target background for composition. For self-supervised learning we need some target backgrounds that has roughly similar lighting as the original videos. Either capture few videos of indoor/outdoor scenes without humans or use our captured background in the `background` folder.
43+
- Create a .csv file `Video_data_train.csv` with each row as: `$image;$captured_back;$segmentation;$image+20frames;$image+2*20frames;$image+3*20frames;$image+4*20frames;$target_back`.
4444
The process is automated by `prepare_real.py` -- take a look inside and change `background_path` and `path` before running.
4545

4646
### Training ###

train_real_fixed.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ def collate_filter_none(batch):
6565

6666
print('\n[Phase 2] : Initialization')
6767

68-
netB=ResnetConditionHR(input_nc=(3,3,1,4),output_nc=4,n_blocks1=args.n_blocks1,n_blocks2=args.n_blocks1)
68+
netB=ResnetConditionHR(input_nc=(3,3,1,4),output_nc=4,n_blocks1=args.n_blocks1,n_blocks2=args.n_blocks2)
6969
netB=nn.DataParallel(netB)
7070
netB.load_state_dict(torch.load(args.init_model))
7171
netB.cuda(); netB.eval()
7272
for param in netB.parameters(): #freeze netD
7373
param.requires_grad = False
7474

75-
netG=ResnetConditionHR(input_nc=(3,3,1,4),output_nc=4,n_blocks1=args.n_blocks1,n_blocks2=args.n_blocks1)
75+
netG=ResnetConditionHR(input_nc=(3,3,1,4),output_nc=4,n_blocks1=args.n_blocks1,n_blocks2=args.n_blocks2)
7676
netG.apply(conv_init)
7777
netG=nn.DataParallel(netG)
7878
netG.cuda()

0 commit comments

Comments
 (0)