Skip to content

Commit

Permalink
add usage and to-do list
Browse files Browse the repository at this point in the history
  • Loading branch information
Siyu-C committed May 16, 2021
1 parent e763cd4 commit fa0a454
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,24 @@ Some key dependencies are listed below, while others are given in [`requirements
- PyTorch >= 1.3, and a corresponding version of torchvision
- ffmpeg (used in data preparation)

## Usage
Default values for arguments `nproc_per_node`, `backend` and `master_port` are `8`, `nccl` and `31114` respectively.

```
python main.py --config CONFIG_FILE [--nproc_per_node N_PROCESSES] [--backend BACKEND] [--master_addr MASTER_ADDR] [--master_port MASTER_PORT]
```

### Running with Multiple Machines
In this case, the `master_addr` argument must be provided. Moreover, arguments `nnodes` and `node_rank` can be additionally specified (similar to `torch.distributed.launch`), otherwise the program will try to obtain their values from environment variables. See [`distributed_utils.py`](https://github.com/Siyu-C/ACAR-Net/blob/master/distributed_utils.py) for details.

## To-do List
- Data preparation for AVA dataset
- Pre-trained models
- Model zoo
- More advanced backbone
- Data preparation for Kinetics dataset, and training on AVA-Kinetics
- Implementation for ACFB

## License
ACAR-Net is released under the [Apache 2.0 license](https://github.com/Siyu-C/ACAR-Net/blob/master/LICENSE).

Expand Down
8 changes: 3 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import time
from easydict import EasyDict
import yaml
from tensorboardX import SummaryWriter

import torch
import torch.optim as optim
Expand All @@ -16,15 +17,12 @@

from calc_mAP import run_evaluation
from datasets import ava, spatial_transforms, temporal_transforms
from distributed_utils import init_distributed
import losses
from models import AVA_model
from scheduler import get_scheduler
from utils import *

from distributed_utils import init_distributed

from tensorboardX import SummaryWriter


def main(local_rank, args):
'''dist init'''
Expand Down Expand Up @@ -437,7 +435,7 @@ def val_epoch(epoch, data_loader, model, criterion, act_func,


if __name__ == '__main__':
parser = argparse.ArgumentParser(description='PyTorch AVA Training')
parser = argparse.ArgumentParser(description='PyTorch AVA Training and Evaluation')
parser.add_argument('--config', type=str, required=True)
parser.add_argument('--nproc_per_node', type=int, default=8)
parser.add_argument('--backend', type=str, default='nccl')
Expand Down
12 changes: 3 additions & 9 deletions models/backbones/slowfast.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
"""
Reference: [SlowFast Networks for Video Recognition](https://arxiv.org/abs/1812.03982).
Adapted code from:
@inproceedings{hara3dcnns,
author={Kensho Hara and Hirokatsu Kataoka and Yutaka Satoh},
title={Can Spatiotemporal 3D CNNs Retrace the History of 2D CNNs and ImageNet?},
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
pages={6546--6555},
year={2018},
}.
References:
[SlowFast Networks for Video Recognition](https://arxiv.org/abs/1812.03982),
[PySlowFast](https://github.com/facebookresearch/slowfast).
"""

import torch
Expand Down

0 comments on commit fa0a454

Please sign in to comment.