Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
2419ad3b
Commit
2419ad3b
authored
Jul 07, 2020
by
Kaushik Shivakumar
Browse files
make minor fixes
parent
4d117df3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
13 deletions
+9
-13
research/object_detection/dataset_tools/create_ava_tf_record.py
...ch/object_detection/dataset_tools/create_ava_tf_record.py
+5
-11
research/object_detection/dataset_tools/download_and_preprocess_ava.sh
...ct_detection/dataset_tools/download_and_preprocess_ava.sh
+4
-2
No files found.
research/object_detection/dataset_tools/create_ava_tf_record.py
View file @
2419ad3b
...
...
@@ -208,7 +208,7 @@ class Ava(object):
reader
=
csv
.
DictReader
(
annotations
,
fieldnames
)
frame_annotations
=
collections
.
defaultdict
(
list
)
ids
=
set
()
# aggreg
g
ate by video and timestamp:
# aggregate by video and timestamp:
for
row
in
reader
:
ids
.
add
(
row
[
"id"
])
key
=
(
row
[
"id"
],
int
(
float
(
row
[
"timestamp_seconds"
])))
...
...
@@ -284,15 +284,7 @@ class Ava(object):
logging
.
warning
(
"Unknown label: %s"
,
row
[
"action_label"
])
#Display the image and bounding boxes being
#processed (for debugging purposes)
#for i in range(len(xmins)):
# cv2.rectangle(image, (int(xmins[i] * width),
# int(ymaxs[i] * height)),
# (int(xmaxs[i] * width),
# int(ymins[i] * height)), (255, 0, 0), 2)
#cv2.imshow("mywindow", image)
#cv2.waitKey(1000)
#processed (for debugging purposes) if desired.
total_xmins
.
append
(
dataset_util
.
float_list_feature
(
xmins
))
total_xmaxs
.
append
(
dataset_util
.
float_list_feature
(
xmaxs
))
...
...
@@ -332,7 +324,9 @@ class Ava(object):
'region/label/string'
:
feature_list_feature
(
total_label_strings
),
'region/label/confidence'
:
feature_list_feature
(
total_confidences
)
feature_list_feature
(
total_confidences
),
#all ones
'region/is_annotated'
:
feature_list_feature
(
total_confidences
)
#all ones
}
if
len
(
total_xmins
)
>
0
:
...
...
research/object_detection/dataset_tools/download_and_preprocess_ava.sh
View file @
2419ad3b
...
...
@@ -16,10 +16,12 @@ done
rm
"ava_file_names_trainval_v2.1.txt"
cd
..
#Trimming causes issues with frame seeking in the python script, so it is best left out.
# Trimming causes issues with frame seeking in the python script, so it is best left out.
# If included, need to modify the python script to subtract 900 seconds wheen seeking.
#echo "Trimming all videos."
#mkdir ava_vids_trimmed
#for filename in ava_vids_raw/*; do
# ffmpeg -ss 900 -to 1800 -i $filename -c copy ava_vids_trimmed/${filename##*/}
#done
\ No newline at end of file
#done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment