Skip to content

Commit

Permalink
A few more UI tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jmancewicz committed Jul 10, 2015
1 parent c857340 commit ac17266
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
8 changes: 1 addition & 7 deletions digits/dataset/images/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,5 @@ class ImageDatasetForm(DatasetForm):
)
resize_mode = wtforms.SelectField(u'Resize Transformation',
default='squash',
choices=[
('crop', 'Crop'),
('squash', 'Squash'),
('fill', 'Fill'),
('half_crop', 'Half crop, half fill'),
]
choices=ImageDatasetJob.choices()
)

13 changes: 13 additions & 0 deletions digits/dataset/images/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,16 @@ def __init__(self, image_dims, resize_mode, **kwargs):
self.image_dims = image_dims
self.resize_mode = resize_mode

@staticmethod
def choices():
return [
('crop', 'Crop'),
('squash', 'Squash'),
('fill', 'Fill'),
('half_crop', 'Half crop, half fill'),
]

def resize_mode_name(self):
c = dict(self.choices())
return c[self.resize_mode]

2 changes: 1 addition & 1 deletion digits/templates/datasets/images/classification/show.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h4>Job Information</h4>
<dt>Image Dimensions</dt>
<dd>{{job.image_dims[1]}}x{{job.image_dims[0]}}</dd>
<dt>Resize Transformation</dt>
<dd>{{ job.resize_mode }}</dd>
<dd>{{ job.resize_mode_name() }}</dd>
</dl>
</div>
{% endmacro %}
Expand Down

0 comments on commit ac17266

Please sign in to comment.