Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependecy update for demo #34

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/GETTING_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ And the full feature extraction is updated in [movienet-tools](https://github.co

### Demo
#### Preparation
- [pytube](https://github.com/nficano/pytube) is to download YouTube video. Install with ```pip install pytube3 --upgrade```
- [pytube](https://github.com/nficano/pytube) is to download YouTube video. Install with ```pip install -U pytube```
- FFMPEG is to cut scene video and it is usually installed by your OS

#### Run
```sh
cd pre
python demodownload.py ## Download a YouTube video with pytube
python ShotDetect/shotdetect.py --print_result --save_keyf --save_keyf_txt ## Cut shot
python ShotDetection/shotdetect.py --print_result --save_keyf --save_keyf_txt ## Cut shot
cd ../lgss
python run.py config/demo.py ## Cut scene
```
Expand Down
4 changes: 3 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
tqdm
mmcv
mmcv-full
tensorboardX
scikit-learn
6 changes: 3 additions & 3 deletions lgss/config/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
video_name = "demo"
shot_num = 4 # even
seq_len = 10 # even
gpus = "0,1,2,3,4,5,6,7"
gpus = "0"

# dataset settings
dataset = dict(
name="demo",
mode=['image'],
mode=['image', 'place'],
)
# model settings
model = dict(
Expand All @@ -39,7 +39,7 @@
resume = None
trainFlag = False
testFlag = True
batch_size = 16
batch_size = 4
epochs = 30
logger = dict(log_interval=200, logs_dir="../run/{}".format(experiment_name))
data_loader_kwargs = dict(num_workers=32, pin_memory=True, drop_last=False)
2 changes: 1 addition & 1 deletion lgss/run.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import print_function

from mmcv import Config
from mmengine import Config
from tensorboardX import SummaryWriter

import src.models as models
Expand Down
2 changes: 1 addition & 1 deletion pre/demodownload.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def main():
os.makedirs("../data/demo", exist_ok = True)
os.makedirs("../data/demo/video", exist_ok = True)
video_save_path = "../data/demo/video"
yt = YouTube('https://www.youtube.com/watch?v=rT22nYLaVbo')
yt = YouTube('https://www.youtube.com/watch?v=9Puz_zu3O3g')
yt.streams.get_highest_resolution().download(video_save_path)
shutil.move(osp.join(video_save_path,os.listdir(video_save_path)[0]),osp.join(video_save_path,"demo.mp4"))

Expand Down
2 changes: 1 addition & 1 deletion pre/place/extract_feat.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def main(args):


if __name__ == '__main__':
data_root = "data/demo"
data_root = "../data/demo"
parser = argparse.ArgumentParser("Place feature using ResNet50 with ImageNet pretrain")
parser.add_argument('--save-one-frame-feat', action="store_true")
parser.add_argument('-b', '--batch-size', type=int, default=512)
Expand Down