Update image processor parameters if creating with kwargs (#20866)
* Update parameters if creating with kwargs * Shallow copy to prevent mutating input * Pass all args in constructor dict - warnings in init * Fix typo
This commit is contained in:
@@ -135,6 +135,15 @@ class ChineseCLIPFeatureExtractionTest(FeatureExtractionSavingTestMixin, unittes
|
||||
self.assertTrue(hasattr(feature_extractor, "image_std"))
|
||||
self.assertTrue(hasattr(feature_extractor, "do_convert_rgb"))
|
||||
|
||||
def test_feat_extract_from_dict_with_kwargs(self):
|
||||
feature_extractor = self.feature_extraction_class.from_dict(self.feat_extract_dict)
|
||||
self.assertEqual(feature_extractor.size, {"height": 224, "width": 224})
|
||||
self.assertEqual(feature_extractor.crop_size, {"height": 18, "width": 18})
|
||||
|
||||
feature_extractor = self.feature_extraction_class.from_dict(self.feat_extract_dict, size=42, crop_size=84)
|
||||
self.assertEqual(feature_extractor.size, {"shortest_edge": 42})
|
||||
self.assertEqual(feature_extractor.crop_size, {"height": 84, "width": 84})
|
||||
|
||||
def test_batch_feature(self):
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user