Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GenVQA
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vision
GenVQA
Commits
319b70d3
Commit
319b70d3
authored
8 years ago
by
tgupta6
Browse files
Options
Downloads
Patches
Plain Diff
obj atr eval uses new genome split
parent
b4e42ac1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
constants_crunchy.py
+2
-2
2 additions, 2 deletions
constants_crunchy.py
object_attribute_classifier_cached_features/eval.py
+16
-20
16 additions, 20 deletions
object_attribute_classifier_cached_features/eval.py
with
18 additions
and
22 deletions
constants_crunchy.py
+
2
−
2
View file @
319b70d3
...
...
@@ -128,8 +128,8 @@ region_model_accuracies_txt = os.path.join(
'
model_accuracies.txt
'
)
# Object Attribute Classifier Evaluation Params
region_eval_on
=
'
val
'
# One of {'
val','
test','train'}
region_model_to_eval
=
region_model
+
'
-
'
+
'
775
00
'
region_eval_on
=
'
test
'
# One of {'test','train
_held_out
'}
region_model_to_eval
=
region_model
+
'
-
'
+
'
340
00
'
region_attribute_scores_dirname
=
os
.
path
.
join
(
region_output_dir
,
...
...
This diff is collapsed.
Click to expand it.
object_attribute_classifier_cached_features/eval.py
+
16
−
20
View file @
319b70d3
...
...
@@ -41,23 +41,27 @@ def create_initializer(graph, sess, model_to_eval):
return
initializer
()
def
create_batch_generator
(
num_samples
,
num_epochs
,
offset
):
def
create_batch_generator
(
region_ids_json
):
data_mgr
=
cropped_regions
.
data
(
constants
.
genome_resnet_feat_dir
,
constants
.
image_dir
,
constants
.
object_labels_json
,
constants
.
attribute_labels_json
,
constants
.
regions_json
,
region_ids_json
,
constants
.
image_size
,
channels
=
3
,
resnet_feat_dim
=
constants
.
resnet_feat_dim
,
mean_image_filename
=
None
)
num_regions
=
len
(
data_mgr
.
region_ids
)
print
num_regions
index_generator
=
tftools
.
data
.
random
(
constants
.
region_batch_size
,
num_
sample
s
,
num_epochs
,
offset
)
num_
region
s
,
1
,
0
)
batch_generator
=
tftools
.
data
.
async_batch_generator
(
data_mgr
,
...
...
@@ -253,24 +257,16 @@ def eval(
if
__name__
==
'
__main__
'
:
num_epochs
=
1
if
constants
.
region_eval_on
==
'
val
'
:
num_samples
=
constants
.
num_val_regions
offset
=
constants
.
num_train_regions
if
constants
.
region_eval_on
==
'
train_held_out
'
:
region_ids_json
=
constants
.
genome_train_held_out_region_ids
elif
constants
.
region_eval_on
==
'
test
'
:
num_samples
=
constants
.
num_test_regions
offset
=
constants
.
num_train_regions
+
\
constants
.
num_val_regions
elif
constants
.
region_eval_on
==
'
train
'
:
num_samples
=
constants
.
num_train_regions
offset
=
0
region_ids_json
=
constants
.
genome_test_region_ids
else
:
print
"
eval_on can only be either
'
val
'
or
'
test
'
or
'
train
'"
print
"
eval_on can only be
'
test
'
or
'
train_held_out
'"
raise
print
'
Creating batch generator...
'
batch_generator
=
create_batch_generator
(
num_samples
,
num_epochs
,
offset
)
batch_generator
=
create_batch_generator
(
region_ids_json
)
print
'
Creating computation graph...
'
graph
=
train
.
graph_creator
(
...
...
@@ -293,8 +289,8 @@ if __name__=='__main__':
initializer
=
create_initializer
(
graph
,
sess
,
constants
.
answer_model_to_eval
)
#
constants.region_model_to_eval)
#
constants.answer_model_to_eval)
constants
.
region_model_to_eval
)
print
'
Creating feed dict creator...
'
feed_dict_creator
=
train
.
create_feed_dict_creator
(
graph
.
plh
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment