Mizukiluke
commited on
Commit
•
eff25bc
1
Parent(s):
357f3f9
add to_dict for processor
Browse files
image_processing_mplugowl3.py
CHANGED
@@ -402,5 +402,12 @@ class mPLUGOwl3ImageProcessor(BaseImageProcessor, CutMixin):
|
|
402 |
cut_shape = cut_shape_indices = None
|
403 |
|
404 |
return mPLUGOwl3BatchFeature(data={'pixel_values': image_data, 'cut_shape':cut_shape, 'cut_shape_indices':cut_shape_indices})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
405 |
|
406 |
AutoImageProcessor.register("mPLUGOwl3ImageProcessor", mPLUGOwl3ImageProcessor)
|
|
|
402 |
cut_shape = cut_shape_indices = None
|
403 |
|
404 |
return mPLUGOwl3BatchFeature(data={'pixel_values': image_data, 'cut_shape':cut_shape, 'cut_shape_indices':cut_shape_indices})
|
405 |
+
|
406 |
+
def to_dict(self):
|
407 |
+
encoder_dict = super().to_dict()
|
408 |
+
pop_keys = ['image_transform', 'resizer', 'old_resizer', 'cut_prompt_template']
|
409 |
+
for pk in pop_keys:
|
410 |
+
encoder_dict.pop(pk, None)
|
411 |
+
return encoder_dict
|
412 |
|
413 |
AutoImageProcessor.register("mPLUGOwl3ImageProcessor", mPLUGOwl3ImageProcessor)
|