Note: Every point in this document is important, as we are dealing with a huge amount of data, fully understanding this document will speed up the process, avoid re-work, and reduce human errors.
~~~~~~~~~~~~~~~~~~~~ 127411s7T7_clip_039 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<LENGTH> 1.74s
<DIM> (W)1920 x (H)1080
<PERSPECTIVE>: {{ }}
<RE_TRIM>: {{ START_TS, END_TS }}
<CRITICAL_POINT>: {{ TS }}
--------------------{{ }}
<QASet_ID>: {{ None }}
<ANS>: {{ }}
--------------------{{ }}
<QASet_ID>: {{ None }}
<ANS>: {{ }}
--------------------{{ }}
<QASet_ID>: {{ None }}
<ANS>: {{ }}
--------------------{{ }}
<QASet_ID>: {{ None }}
<ANS>: {{ }}
--------------------{{ }}
<QASet_ID>: {{ None }}
<ANS>: {{ }}
- Go to this Google Sheet: UROP_CV_2020_Shared / Video Dataset Progress Tracking
- At the
Labelling Process
tab, choose aTODO
task. - Put your name under
Labelled by
- Change
TODO
toIn Progress
- Remember the
Folder Name
you picked
- At the
- Go to this folder: UROP_CV_2020_Shared / Video_Folders / Trimmed_All_Videos
- Go to the
Folder Name
you picked. - Sort the folder by
Last Modified
in descending (reverse) order. - Download the latest version of
qa_label_template
file inside the folder.qa_label_template_v2.txt
is the latest version in this case. - The order of the videos inside the
qa_label_template
should be the same as Google Drive's order now, which is sorted by last modified time in descending order. - If you download all videos to local, and sort them by last modified time, the order should remain same and consistent.
- Go to the
- A video can be either 1st-person perspective or 3rd-person perspective
- 1st-person perspective could be any of these scenarios:
- The camera is mounted inside a car, and the car itself is directly involved in an accident, including the car hitting another car, or the car is hit by another car.
- The camera is handheld, but whoever holding the camera is directly involved in the event / car crash / accident.
- 3rd-person perspective could be any of these scenarios:
- The camera is mounted inside a car, and it is observing an accident happening on other cars but not itself.
- The camera is handheld by a pedestrian, and it is observing an accident from distance.
- The camera is a stationary CCTV camera mounted over the head.
- 1st-person perspective could be any of these scenarios:
- The
qa_label_template.txt
has this line for every video section.<PERSPECTIVE>: {{ }}
- Just use number
1
or3
to indicate 1st-person perspective or 3rd-person perspective. - Example:
<PERSPECTIVE>: {{ 1 }}
<PERSPECTIVE>: {{ 3 }}
- If the start and the end of the video clip show any frame from adjacent events from the original video compilation, we need to re-trim the video to remove the unrelated portion.
- To re-trim, just provide the
START_TS
(starting timestamp) and theEND_TS
(ending timestamp) of the part of the video that we want to keep. - The
qa_label_template.txt
has this line for every video section.<RE_TRIM>: {{ START_TS, END_TS }}
START_TS
andEND_TS
should strictly follow the Time Format.- If no re-trimming is needed, leave the line
{{ START_TS, END_TS }}
as it is. - You can only provide one timestamp, either
START_TS
orEND_TS
.- E.g. You can only replace
START_TS
to00:03
, and leaveEND_TS
as it is. In this way, you are telling the script that you want to trim and keep the video from00:03
till the end of the video.
- E.g. You can only replace
- Sexagesimal (HOURS:MM:SS.MILLISECONDS).
- Most common format would be:
MM:SS
- Example:
00:12
interpreted as 12 seconds01:23
interpreted as 1 minute, 23 seconds
- Example:
- If you want to be precise on the trimming point, especially for
<CRITICAL_POINT>
, because some accidents happen in a fraction of a second, you can useMM:SS.MILLISECONDS
- Example:
3
interpreted as 3 seconds.15.6
interpreted as 15.6 seconds.15.25
interpreted as 15 seconds and 1/4 second.02:30.05
interpreted as 2 minutes, 30 seconds, and 5/100 of a second.02:30.189
interpreted as 2 minutes, 30 seconds, and 189/1000 of a second.
- Example:
- If you want to ask either
Predictive
orReverse Inference
type of question to a video, you would need to cut the video in half, because only half of the video is shown to the DL Model, while the other half of the video will be reserved as a proof of the answer. - The critical timestamp or the critical point is where you want to cut the video, you only need to provide a single
TS
(timestamp), our script will later cut the video into two parts:- from video start to
TS
- from
TS
to video end.
- from video start to
- The
qa_label_template.txt
has this line for every video section.<CRITICAL_POINT>: {{ TS }}
- Replace
TS
with a timestamp that follows Time Format, or leave it as it is if this video does not havePredictive
norReverse Inference
question type.
Special notes:
- Each video should only have either one
Predictive
orReverse Inference
, not both. - Which part of the video will be used as question will be determined by the question type.
- If
Predictive
, first part of the video will be used asquestion video
. - if
Reverse Inference
, the second part of the video will be used asquestion video
.
- If
- When there is a
<CRITICAL_POINT>
present, other questions under that video should only based on thequestion video
. - When
<RE_TRIM>
and<CRITICAL_POINT>
both present, the timestamp of the<CRITICAL_POINT>
should still based on original video timeline, hence, the<CRITICAL_POINT>
timestamp should betweenSTART_TS
andEND_TS
, otherwise it will be flagged out as an error.
- Each question section looks like this:
--------------------{{ }} // Q Type: use [1-6]|[d|e|p|r|c|i] <QASet_ID>: {{ None }} <ANS>: {{ }}
- On the 1st line, fill in the question type in the double curly braces:
- use
1
ord
for Descriptive. - use
2
ore
for Explanatory. - use
3
orp
for Predictive. - use
4
orr
for Reverse Inference. - use
5
orc
for Counterfactual. - use
6
ori
for Introspection. - Example:
--------------------{{ d }}
- use
- On the 2nd line, this is used for
QASet
substitution, leave it as it is or see About QASet substitution. - On the 3rd line, label the correct answer for the question.
- Each question should have 2 to 5 options. (Only at extreme cases, we support up to 7 options)
- use
a
orA
for choosing the first option as the correct answer. - use
b
orB
for choosing the second option as the correct answer. - ...
- use
e
orE
for choosing the fifth option as the correct answer.
- use
- Multiple correct answers are also supported.
- use
ab
to represent both the first and the second options are correct answer.
- use
- Examples:
<ANS>: {{ c }}
// lower case is acceptable<ANS>: {{ B }}
// upper case is acceptable<ANS>: {{ad}}
// with or without whitespace is acceptable<ANS>: {{ e c b }}
// alphabets not in order is acceptable
- Each question should have 2 to 5 options. (Only at extreme cases, we support up to 7 options)
- On the 4th line, which is the line right below the
<ANS>: {{ }}
, should be the start of a custom question and its corresponding options.- Put your question on the 4th line, and always end the question with a question mark
?
. - Put your options to the question down below, one option per line.
- The first option corresponds to option
A
, the next line corresponds to optionB
and so on. - Instead of using
a/b/c/d
to indicate the correct answer, you can also use the plus sign+
at the start of an option line as an alternative. For Example:<ANS>: {{ }} How many cars were involved in the accident? only one two three to five +more than five
- You can even use
<ANS>
together with plus sign+
, there is no harm to do so. In the following example, both optionA
and optionC
will be interpreted as correct answers.<ANS>: {{ a }} Which part of the car has been damaged? front left side +right side rear
<ANS>: {{ }}
can be left empty if you have at least one plus sign+
below indicating at least one correct answer, otherwise, it will be flagged out as unlabelled question.
- Put your question on the 4th line, and always end the question with a question mark
- To speed up the process, we have pre-populated 7 basic questions for each video randomly.
- Your job now is mainly to review these questions together with the video clip.
- If the question and its options are slightly off the video context.
- you should make necessary modifications on it.
- After you made the modifications, or, if the question and its options fits the video context perfectly at the first place.
- you need to label the correct answer for that question using either
<ANS>
or+
as you wish. - As long as you labelled the correct answer, that question will be deemed reviewed and confirmed, so it will be picked up by our parser in later stage.
- you need to label the correct answer for that question using either
- If the question and its options are totally off, which does not suit the video at all.
- you can remove the question section from the label file.
- Alternatively, you can leave it as it is, because a question with no correct answer labelled will be ignored anyway.
- If all 7 pre-populated questions can be used, keep them all.
- After removing the unfit questions, you should make sure there are at least 3 basic questions for every video.
- If the question and its options are slightly off the video context.
- Please refer to this document for details.
- You need to maintain a local QA Bank for your own use.
- Download QA Bank Template as excel from here.
- Populate and maintain this QA Bank excel sheet at your local, be careful not to overwrite/ update questions that have been referenced by your label files.
- Key points to note:
- This excel sheet should have only one tab.
- The header row (first row) must not be changed.
- Each question should have a unique ID (positive integer), except rephrased questions.
- You just need to make sure the ID is unique for your excel sheet only.
- To label a video using your local QA Bank
- simply provide the question ID in your label file at
<QASet_ID>: {{ }}
, then label the correct answer at<ANS>: {{ }}
. Example:--------------------{{ }} <QASet_ID>: {{ 5 }} <ANS>: {{ a }}
- you don't need to provide the question type, since the parser will get the question type info from your QA bank later.
- If you want to add additional options to the QA, you may do so below the
<ANS>: {{ }}
line, these additional options will be appended to the existing options list from your QA bank for this particular question. - If the correct answer is among the additional options, you may use either
<ANS>
or+
as you wish, or even in combination. But, note that if the QASet from your QA Bank has 4 options, and you have provided two additional options, the indexes for the two additional options areE
&F
. Example:--------------------{{ }} <QASet_ID>: {{ 5 }} <ANS>: {{ }} red +green --------------------{{ }} <QASet_ID>: {{ 19 }} <ANS>: {{ ab }} Stop sign +Merging lane sign Speed sign
- simply provide the question ID in your label file at
-
Step 1: Export your QA Bank excel sheet to
json
format.pip3 install --upgrade easylabeltool
qabank "YOUR_QA_BANK_EXCEL_FILE _ATH_HERE"
Example
This will validate and export your QA Bank
QA_BANK.xlsx
toQA_BANK.json
.qabank "QA_BANK.xlsx"
-
Step 2: Parse your Label File with QASet Substitution
parse "YOUR_LABEL_FILE_PATH_HERE" "YOUR_QA_BANK_JSON_FILE_PATH_HERE"
Example
This will validate and export your label file
qa_label.txt
into.json
format with substituted QASets from your local QA Bank. Please double check the genertated json file to make sure the substitution has been done as you expected.parse "qa_label.txt" "QA_BANK.json"
~~~~~~~~~~~~~~~~~~~~ 127411s7T7_clip_039 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<LENGTH> 1.74s
<DIM> (W)1920 x (H)1080
<PERSPECTIVE>: {{ 3 }}
<RE_TRIM>: {{ 00:02, 00:15 }}
<CRITICAL_POINT>: {{ 00:12 }}
--------------------{{ d }}
<QASet_ID>: {{ None }}
<ANS>: {{ a }}
Did a person cross the road in the video?
yes
no
--------------------{{ d }}
<QASet_ID>: {{ None }}
<ANS>: {{ d }}
How many cars were involved in the accident?
only one
two
three to five
more than five
--------------------{{ d }}
<QASet_ID>: {{ None }}
<ANS>: {{ }}
What's the colour of the traffic light when the car pass under?
green
yellow
+red
no traffic light
--------------------{{ e }}
<QASet_ID>: {{ None }}
<ANS>: {{ a }}
What kind of accident happened in the video?
Rear-end
side-collision
road-departure
head-on
--------------------{{ p }}
<QASet_ID>: {{ None }}
<ANS>: {{ b }}
is the car on the right going to change lane?
yes
no
- We have packaged the validation tool into a python package, so you just need to
pip install
it. - You can install it in a python
virtualenv
, but installing it globally is also fine, because it is pretty lightweight, and you can uninstall it after we are done with it.
-
Install the package
pip3 install --upgrade easylabeltool
-
Parse your Label file
parse "YOUR_LABEL_FILE_PATH_HERE"
Example
This will validate and export your label file
qa_label_template.txt
into.json
formatparse "bilibili_003/qa_label_template.txt"
-
Upload your Label file
- Rename your
qa_label_template.txt
to[folder_name].txt
, such asbilibili_003.txt
- Rename the generated
qa_label.json
to[folder_name].json
, such asbilibili_003.json
- Upload both files into this folder: UROP_CV_2020_Shared / Video_Folders / Label_Files