| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This repository contrains code for the TPAMI paper Multi-Task Learning of Object States and State-Modifying Actions from Web Videos.
Setup the environment
docker build -t multi-task-object-states .
docker run -it --rm --gpus all -v $(pwd):$(pwd) -w $(pwd) --user=$(id -u $USER):$(id -g $USER) multi-task-object-states bash
Download requirements
Download dataset
Train a model
python train.py --video_roots ./videos
--dataset_root ./ChangeIt
--train_backbone
--augment
--local_batch_size 2
python train.py --video_roots *dir*
--dataset_root *dataset*
--train_backbone
--augment
--local_batch_size 2
--ignore_video_weight
Here is an example code for the inference of a trained model.
checkpoint = torch.load("path/to/saved/model.pth", map_location="cpu")
model = ClipClassifier(params=checkpoint["args"],
n_classes=checkpoint["n_classes"],
hidden_mlp_layers=checkpoint["hidden_mlp_layers"]).cuda()
model.load_state_dict({k.replace("module.", ""): v for k, v in checkpoint["state_dict"].items()})
video_frames = torch.from_numpy(
extract_frames(video_fn, fps=1, size=(398, 224), crop=(398 - 224, 0)))
with torch.no_grad():
predictions = model(video_frames.cuda())
state_pred, action_pred = torch.softmax(predictions["state"], -1), torch.softmax(predictions["action"], -1)@article{soucek2024multitask,
title={Multi-Task Learning of Object States and State-Modifying Actions from Web Videos},
author={Sou\v{c}ek, Tom\'{a}\v{s} and Alayrac, Jean-Baptiste and Miech, Antoine and Laptev, Ivan and Sivic, Josef},
journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
year={2024},
doi={10.1109/TPAMI.2024.3362288}
}This work was partly supported by the European Regional Development Fund under the project IMPACT (reg. no. CZ.02.1.01/0.0/0.0/15_003/0000468), the Ministry of Education, Youth and Sports of the Czech Republic through the e-INFRA CZ (ID:90140), the French government under management of Agence Nationale de la Recherche as part of the “Investissements d’avenir” program, reference ANR19-P3IA-0001 (PRAIRIE 3IA Institute), and Louis Vuitton ENS Chair on Artificial Intelligence.
The ordering constraint code has been adapted from the CVPR 2022 paper Look for the Change: Learning Object States and State-Modifying Actions from Untrimmed Web Videos available on GitHub.
| Back | FazBrowse Home | New Git URL |