-
Notifications
You must be signed in to change notification settings - Fork 863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 1120 #1271
Issue 1120 #1271
Changes from 13 commits
8a8c363
a5cd198
4dd1783
e377bc0
13ab7f5
7d2f2d6
fb57045
6a57116
01048fa
07da5ca
4e795f0
2a018f0
d607dcc
3d30f4c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,19 +11,21 @@ class Context(object): | |
Some fixed during load times and some | ||
""" | ||
|
||
def __init__(self, model_name, model_dir, manifest, batch_size, gpu, mms_version): | ||
def __init__(self, model_name, model_dir, manifest, batch_size, gpu, mms_version, limit_max_image_pixels=True): | ||
self.model_name = model_name | ||
self.manifest = manifest | ||
self._system_properties = { | ||
"model_dir": model_dir, | ||
"gpu_id": gpu, | ||
"batch_size": batch_size, | ||
"server_name": "MMS", | ||
"server_version": mms_version | ||
"server_version": mms_version, | ||
"limit_max_image_pixels": limit_max_image_pixels, | ||
} | ||
self.request_ids = None | ||
self.request_processor = None | ||
self._metrics = None | ||
self._limit_max_image_pixels = True | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you elaborate on how this is further used |
||
|
||
@property | ||
def system_properties(self): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,9 @@ def initialize(self, context): | |
super().initialize(context) | ||
self.ig = IntegratedGradients(self.model) | ||
self.initialized = True | ||
properties = context.system_properties | ||
if not properties.get("limit_max_image_pixels") : | ||
Image.MAX_IMAGE_PIXELS = None | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here, we're setting value to None, however, it does not seem to be clear what happens if this value is not None, does PILLOW automatically pick it up from context? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as the above, the detailed information is provided in pillow link |
||
|
||
def preprocess(self, data): | ||
"""The preprocess function of MNIST program converts the input data to a float tensor | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @lxning, could you add more details on how the
limit_max_image_pixels
, fixes the related issue #1120 ? Or, at least aids in the resolution of the issue? [Request to add details in the PR description]. Is the idea that a user should be able to limit the size of the input image?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the detailed information is provided in the above link