Skip to content
Recover CSS code from Web animation
Python JavaScript Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
caption
data
error_analysis
models
resource
results
two-stream
utils
web
.gitignore
LICENSE
README.md
ast.json
error.json
full_labels.json
generating-code-from-animation.pdf
main.py
package-lock.json
package.json
src-train.txt
src-val.txt
tgt-train.txt
tgt-val.txt

README.md

CSS2Code

[paper]

Install for Mac

brew install ffmpeg
npm install

Generate Dataset

  1. generate HTML
node utils/generate_html.js
  1. generate video
python utils/record.py --html_path /home/josh/{your_project}/{your_html_path} --video_path data/
  1. generate annotation file
node utils/generate_annotations.js

Training Setup

  1. download training video here

  2. download annotation file here

  3. generate images from video

  4. generate n_frames file

Training

python main.py --root_path ./data --video_path images/ --annotation_path annotations.json --result_path results --model resnet --model_depth 18 --n_classes 77 --batch_size 4 --n_threads 4 --checkpoint 5 --sample_size 240 --sample_duration 70

nohup python main.py --root_path ./data --video_path images/ --annotation_path annotations.json --result_path results_10_noscale --model resnet --model_depth 10 --n_classes 77 --batch_size 4 --n_threads 4 --checkpoint 10 --sample_size 240 --sample_duration 70 --n_val_samples 10 --no_hflip --n_scales 1 > /dev/null &

Evaluation

python main.py --root_path ./data --video_path images/ --annotation_path annotations.json --result_path results --model resnet --model_depth 18 --n_classes 77 --batch_size 4 --n_threads 4 --checkpoint 5 --sample_size 240 --sample_duration 70 --resume_path save_60.pth

Saving features

python main.py --root_path ./data --video_path images/ --annotation_path annotations.json --result_path results_features --model resnet --model_depth 10 --n_classes 77 --batch_size 4 --n_threads 4 --checkpoint 1 --sample_size 240 --sample_duration 70 --resume_path save_60.pth --n_epochs=61 --dataset ucf101

trainning captioning

cd caption
python train.py

remove scale

remove horizontal flipping

extend window size

You can’t perform that action at this time.