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
a1ab2133
Commit
a1ab2133
authored
Jun 21, 2021
by
Vincent Dumoulin
Committed by
A. Unique TensorFlower
Jun 21, 2021
Browse files
Internal change
PiperOrigin-RevId: 380650647
parent
9db02678
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
official/vision/beta/data/process_coco_few_shot.sh
official/vision/beta/data/process_coco_few_shot.sh
+11
-1
official/vision/beta/data/process_coco_few_shot_json_files.py
...cial/vision/beta/data/process_coco_few_shot_json_files.py
+18
-0
No files found.
official/vision/beta/data/process_coco_few_shot.sh
View file @
a1ab2133
...
@@ -13,7 +13,7 @@ done
...
@@ -13,7 +13,7 @@ done
cocosplit_url
=
"dl.yf.io/fs-det/datasets/cocosplit"
cocosplit_url
=
"dl.yf.io/fs-det/datasets/cocosplit"
wget
--recursive
--no-parent
-q
--show-progress
--progress
=
bar:force:noscroll
\
wget
--recursive
--no-parent
-q
--show-progress
--progress
=
bar:force:noscroll
\
-P
"
${
tmp_dir
}
"
-A
"5k.json,*10shot*.json,*30shot*.json"
\
-P
"
${
tmp_dir
}
"
-A
"
trainvalno5k.json,
5k.json,*10shot*.json,*30shot*.json"
\
"http://
${
cocosplit_url
}
/"
"http://
${
cocosplit_url
}
/"
mv
"
${
tmp_dir
}
/
${
cocosplit_url
}
/"
*
"
${
tmp_dir
}
"
mv
"
${
tmp_dir
}
/
${
cocosplit_url
}
/"
*
"
${
tmp_dir
}
"
rm
-rf
"
${
tmp_dir
}
/
${
cocosplit_url
}
/"
rm
-rf
"
${
tmp_dir
}
/
${
cocosplit_url
}
/"
...
@@ -45,4 +45,14 @@ python create_coco_tf_record.py \
...
@@ -45,4 +45,14 @@ python create_coco_tf_record.py \
--output_file_prefix
=
"
${
output_dir
}
/5k"
\
--output_file_prefix
=
"
${
output_dir
}
/5k"
\
--num_shards
=
10
--num_shards
=
10
python create_coco_tf_record.py
\
--logtostderr
\
--image_dir
=
/namespace/vale-project/datasets/mscoco_raw/images/train2014
\
--image_dir
=
/namespace/vale-project/datasets/mscoco_raw/images/val2014
\
--image_info_file
=
"
${
tmp_dir
}
/datasplit/trainvalno5k_base.json"
\
--object_annotations_file
=
"
${
tmp_dir
}
/datasplit/trainvalno5k_base.json"
\
--caption_annotations_file
=
""
\
--output_file_prefix
=
"
${
output_dir
}
/trainvalno5k_base"
\
--num_shards
=
200
rm
-rf
"
${
tmp_dir
}
"
rm
-rf
"
${
tmp_dir
}
"
official/vision/beta/data/process_coco_few_shot_json_files.py
View file @
a1ab2133
...
@@ -76,10 +76,28 @@ for _seed, _shots in itertools.product(SEEDS, SHOTS):
...
@@ -76,10 +76,28 @@ for _seed, _shots in itertools.product(SEEDS, SHOTS):
_shots
,
_shots
,
_category
))
_category
))
# Base class IDs, as defined in
# https://github.com/ucbdrive/few-shot-object-detection/blob/master/fsdet/evaluation/coco_evaluation.py#L60-L65
BASE_CLASS_IDS
=
[
8
,
10
,
11
,
13
,
14
,
15
,
22
,
23
,
24
,
25
,
27
,
28
,
31
,
32
,
33
,
34
,
35
,
36
,
37
,
38
,
39
,
40
,
41
,
42
,
43
,
46
,
47
,
48
,
49
,
50
,
51
,
52
,
53
,
54
,
55
,
56
,
57
,
58
,
59
,
60
,
61
,
65
,
70
,
73
,
74
,
75
,
76
,
77
,
78
,
79
,
80
,
81
,
82
,
84
,
85
,
86
,
87
,
88
,
89
,
90
]
def
main
(
unused_argv
):
def
main
(
unused_argv
):
workdir
=
FLAGS
.
workdir
workdir
=
FLAGS
.
workdir
# Filter novel class annotations from the training set.
file_path
=
os
.
path
.
join
(
workdir
,
'datasplit'
,
'trainvalno5k.json'
)
with
tf
.
io
.
gfile
.
GFile
(
file_path
,
'r'
)
as
f
:
json_dict
=
json
.
load
(
f
)
json_dict
[
'annotations'
]
=
[
a
for
a
in
json_dict
[
'annotations'
]
if
a
[
'category_id'
]
in
BASE_CLASS_IDS
]
output_path
=
os
.
path
.
join
(
workdir
,
'datasplit'
,
'trainvalno5k_base.json'
)
with
tf
.
io
.
gfile
.
GFile
(
output_path
,
'w'
)
as
f
:
json
.
dump
(
json_dict
,
f
)
for
seed
,
shots
in
itertools
.
product
(
SEEDS
,
SHOTS
):
for
seed
,
shots
in
itertools
.
product
(
SEEDS
,
SHOTS
):
# Retrieve all examples for a given seed and shots setting.
# Retrieve all examples for a given seed and shots setting.
file_paths
=
[
os
.
path
.
join
(
workdir
,
suffix
)
file_paths
=
[
os
.
path
.
join
(
workdir
,
suffix
)
...
...
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