🚧 Use voter from JSON config

fix/readme-no-checkpoint
Gerber, Mike 5 years ago
parent 67aa3db357
commit 64794363d8

@ -33,7 +33,7 @@ class CalamariOcr(Processor):
self.predictor = MultiPredictor(checkpoints=checkpoints) self.predictor = MultiPredictor(checkpoints=checkpoints)
voter_params = VoterParams() voter_params = VoterParams()
voter_params.type = VoterParams.Type.Value('confidence_voter_default_ctc'.upper()) voter_params.type = VoterParams.Type.Value(self.parameter['voter'].upper())
self.voter = voter_from_proto(voter_params) self.voter = voter_from_proto(voter_params)
def resolve_image_as_np(self, image_url, coords): def resolve_image_as_np(self, image_url, coords):

@ -21,7 +21,7 @@
"XXX checkpoint": {"type": "string", "format": "file", "cacheable": true}, "XXX checkpoint": {"type": "string", "format": "file", "cacheable": true},
"processes": {"type": "number", "default": 1}, "processes": {"type": "number", "default": 1},
"batch_size": {"type": "number", "default": 1}, "batch_size": {"type": "number", "default": 1},
"XXX voter": {"type": "string", "default": "confidence_voter_default_ctc"}, "voter": {"type": "string", "default": "confidence_voter_default_ctc"},
"XXXX extended_prediction_data_format": {"type": "string", "default": "json"}, "XXXX extended_prediction_data_format": {"type": "string", "default": "json"},
"XXX output_dir": "TODO", "XXX output_dir": "TODO",
"XXX extended_prediction_data": "TODO" "XXX extended_prediction_data": "TODO"

Loading…
Cancel
Save