INNER CODE UNIT · Python

single_x_classification

aniketmaurya/chitra · chitra/serve/app.py:73

    def single_x_classification(self, x: np.ndarray):
        data_processor = self.data_processor

        if data_processor.preprocess_fn:
            x = data_processor.preprocess(x, **self.preprocess_conf)
        x = self.model(x)
        if data_processor.postprocess_fn:
            x = data_processor.postprocess(x, **self.postprocess_conf)
        return x

    def run(self, share: bool = False, gr_interface_conf: Optional[dict] = None):
        if not gr_interface_conf:
            gr_interface_conf = {}

        gr.Interface(
            fn=self.api_type_func[self.api_type],
            inputs=self.input_types,
            outputs=self.output_types,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…