Skip to content

Commit 326c42c

Browse files
ehofesmannzeonzir
authored andcommitted
Update json template frame size, fix num_clip=0 bug (#3)
* Update json template frame size, fix num_clip=0 bug Update README.md with link to wiki
1 parent 0326d61 commit 326c42c

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
A platform for quick and easy development of deep learning networks for recognition and detection in videos. Includes popular models like C3D and SSD.
44

5+
Check out our [wiki!](https://github.com/MichiganCOG/ViP/wiki)
6+
57
## Implemented Models and their performance
68

79
### Recognition
@@ -26,7 +28,7 @@ A platform for quick and easy development of deep learning networks for recognit
2628
* [Development](#development)
2729
* [Add a Model](#add-a-model)
2830
* [Add a Dataset](#add-a-dataset)
29-
* [Version History](#version-history)
31+
* [FAQ](#faq)
3032

3133
## Configured Datasets
3234
| Dataset | Task(s) |
@@ -88,6 +90,9 @@ Ex: From the root directory of ViP, train the action recognition network C3D on
8890
```
8991
python train.py --cfg_file models/c3d/config_train.yaml
9092
```
93+
94+
Additional examples can be found on our [wiki.](https://github.com/MichiganCOG/ViP/wiki)
95+
9196
## Development
9297

9398
New models and datasets can be added without needing to rewrite any training, evaluation, or data loading code.
@@ -103,6 +108,8 @@ To add a new model:
103108

104109
Examples of previously implemented models can be found [here](https://github.com/MichiganCOG/ViP/tree/master/models).
105110

111+
Additional information can be found on our [wiki.](https://github.com/MichiganCOG/ViP/wiki)
112+
106113
### Add a Dataset
107114

108115
To add a new dataset:
@@ -114,3 +121,8 @@ To add a new dataset:
114121
* Complete `__init__` and `__getitem__` functions
115122
* Example skeleton dataset can be found [here](https://github.com/MichiganCOG/ViP/blob/master/datasets/templates/dataset_template.py)
116123

124+
Additional information can be found on our [wiki.](https://github.com/MichiganCOG/ViP/wiki)
125+
126+
### FAQ
127+
128+
A detailed FAQ can be found on our [wiki](https://github.com/MichiganCOG/ViP/wiki/FAQ).

datasets/abstract_datasets.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def _extractClips(self, video):
7171
if self.num_clips < 0:
7272
if len(video) >= self.clip_length:
7373
final_video = [video[_idx] for _idx in np.linspace(0, len(video)-1, self.clip_length, dtype='int32')]
74+
final_video = [final_video]
7475

7576
else:
7677
# Loop if insufficient elements
@@ -80,6 +81,7 @@ def _extractClips(self, video):
8081
indices = indices[np.linspace(0, len(indices)-1, self.clip_length, dtype='int32')]
8182

8283
final_video = [video[_idx] for _idx in indices]
84+
final_video = [final_video]
8385

8486

8587
# END IF
@@ -103,6 +105,7 @@ def _extractClips(self, video):
103105
indices = indices[:self.clip_length]
104106

105107
final_video = [video[_idx] for _idx in indices]
108+
final_video = [final_video]
106109

107110
# END IF
108111

@@ -114,6 +117,7 @@ def _extractClips(self, video):
114117
indices = np.arange(indices, indices + self.clip_length).astype('int32')
115118

116119
final_video = [video[_idx] for _idx in indices]
120+
final_video = [final_video]
117121

118122
else:
119123
indices = np.ceil(self.clip_length/float(len(video)))
@@ -125,17 +129,19 @@ def _extractClips(self, video):
125129
indices = indices[index:index + self.clip_length]
126130

127131
final_video = [video[_idx] for _idx in indices]
132+
final_video = [final_video]
128133

129134
# END IF
130135

131136
else:
132137
final_video = video[:self.clip_length]
138+
final_video = [final_video]
133139

134140
# END IF
135141

136142
# END IF
137143

138-
return [final_video]
144+
return final_video
139145

140146

141147

datasets/templates/action_recognition_template.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
{
33
"frames (list)": [
44
{
5-
"frame_size (int, int)": "(WIDTH,HEIGHT)",
65
"img_path (str)": "FRAME_PATH",
76
"actions (list)": [
87
{
@@ -11,6 +10,7 @@
1110
]
1211
}
1312
],
13+
"frame_size (int, int)": "(WIDTH,HEIGHT)",
1414
"base_path (str)": "BASE_VID_PATH"
1515
}
16-
]
16+
]

datasets/templates/detection_template.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
{
33
"frames (list)": [
44
{
5-
"frame_size (int, int)": "(WIDTH,HEIGHT)",
65
"img_path (str)": "FRAME_PATH",
76
"objs (list)": [
87
{
@@ -14,6 +13,7 @@
1413
]
1514
}
1615
],
17-
"base_path (str)": "BASE_VID_PATH"
16+
"base_path (str)": "BASE_VID_PATH",
17+
"frame_size (int, int)": "(WIDTH,HEIGHT)"
1818
}
19-
]
19+
]

0 commit comments

Comments
 (0)