From 47497e9a3538a936f1a02eb7404899b0801da9a5 Mon Sep 17 00:00:00 2001 From: 1chooo Date: Mon, 11 Sep 2023 17:32:19 +0800 Subject: [PATCH] fix: Classifier playground --- Refinaid/App/app.py | 1 - .../Playground/Classifier/Dashborad/Header.py | 4 ++-- .../Classifier/Dashborad/Preprocessing.py | 24 ++++++++++++------- .../Classifier/Dashborad/Training.py | 4 ++-- .../Classifier/Dashborad/TrainingHistory.py | 4 ++-- Refinaid/Playground/Classifier/Example.py | 2 +- Refinaid/Playground/Classifier/Launch.py | 15 ++++++------ Refinaid/Utils/Listener.py | 2 +- 8 files changed, 31 insertions(+), 25 deletions(-) diff --git a/Refinaid/App/app.py b/Refinaid/App/app.py index 7ce2ad9..65723f6 100644 --- a/Refinaid/App/app.py +++ b/Refinaid/App/app.py @@ -10,7 +10,6 @@ from fastapi.responses import HTMLResponse, FileResponse from fastapi.staticfiles import StaticFiles from Refinaid.Playground.Classifier.Launch import build_ui -from Refinaid.gui.Launch import build_ui from fastapi import Form, Depends, HTTPException import gradio as gr diff --git a/Refinaid/Playground/Classifier/Dashborad/Header.py b/Refinaid/Playground/Classifier/Dashborad/Header.py index 15578ae..5a5a3ff 100644 --- a/Refinaid/Playground/Classifier/Dashborad/Header.py +++ b/Refinaid/Playground/Classifier/Dashborad/Header.py @@ -2,11 +2,11 @@ ''' Create Date: 2023/09/11 Author: @1chooo(Hugo ChunHo Lin) -Version: v0.1.2 +Version: v0.1.4 ''' import gradio as gr -from Refinaid.gui.Information import PageContent +from Refinaid.Playground.Classifier.Information import PageContent from typing import Any class PageHeader: diff --git a/Refinaid/Playground/Classifier/Dashborad/Preprocessing.py b/Refinaid/Playground/Classifier/Dashborad/Preprocessing.py index 9b80a72..34c0614 100644 --- a/Refinaid/Playground/Classifier/Dashborad/Preprocessing.py +++ b/Refinaid/Playground/Classifier/Dashborad/Preprocessing.py @@ -2,11 +2,11 @@ ''' Create Date: 2023/09/11 Author: @1chooo(Hugo ChunHo Lin) -Version: v0.1.2 +Version: v0.1.4 ''' import gradio as gr -from Refinaid.gui.Information import PageContent +from Refinaid.Playground.Classifier.Information import PageContent from typing import Any, Tuple from Refinaid.Action.Load import get_dataframe @@ -67,7 +67,10 @@ def get_select_mutiple_parameters_info( ) def get_missing_values_handling_info( - self, *args: Any, **kwargs: Any) -> Tuple[ + self, + *args: Any, + **kwargs: Any, + ) -> Tuple[ gr.Markdown, gr.Radio ]: @@ -90,7 +93,8 @@ def get_missing_values_handling_info( ) def get_data_scale_info( - self, *args: Any, **kwargs: Any) -> Tuple[ + self, *args: Any, **kwargs: Any + ) -> Tuple[ gr.Markdown, gr.Radio ]: @@ -115,7 +119,8 @@ def get_data_scale_info( ) def get_data_split_info( - self, *args: Any, **kwargs: Any) -> Tuple[ + self, *args: Any, **kwargs: Any + ) -> Tuple[ gr.Markdown, gr.Slider, gr.Slider, @@ -158,7 +163,8 @@ def get_data_split_info( ) def get_submit_dataset_setting_btn( - self, *args: Any, **kwargs: Any) -> Tuple[ + self, *args: Any, **kwargs: Any + ) -> Tuple[ gr.Button ]: @@ -171,7 +177,8 @@ def get_submit_dataset_setting_btn( ) def get_preprocessing_visulize_info( - self, *args: Any, **kwargs: Any) -> Tuple[ + self, *args: Any, **kwargs: Any + ) -> Tuple[ gr.Markdown, gr.ScatterPlot ]: @@ -196,7 +203,8 @@ def get_preprocessing_visulize_info( ) def get_preprocessing_visualize_axis_info( - self, *args: Any, **kwargs: Any) -> Tuple[ + self, *args: Any, **kwargs: Any + ) -> Tuple[ gr.Dropdown, gr.Dropdown ]: x_axis_dropdown = gr.Dropdown( diff --git a/Refinaid/Playground/Classifier/Dashborad/Training.py b/Refinaid/Playground/Classifier/Dashborad/Training.py index 508c084..c710bb5 100644 --- a/Refinaid/Playground/Classifier/Dashborad/Training.py +++ b/Refinaid/Playground/Classifier/Dashborad/Training.py @@ -2,11 +2,11 @@ ''' Create Date: 2023/09/11 Author: @1chooo(Hugo ChunHo Lin) -Version: v0.1.2 +Version: v0.1.4 ''' import gradio as gr -from Refinaid.gui.Information import PageContent +from Refinaid.Playground.Classifier.Information import PageContent from typing import Any, Tuple class TrainingComponent: diff --git a/Refinaid/Playground/Classifier/Dashborad/TrainingHistory.py b/Refinaid/Playground/Classifier/Dashborad/TrainingHistory.py index 074706b..3941c7c 100644 --- a/Refinaid/Playground/Classifier/Dashborad/TrainingHistory.py +++ b/Refinaid/Playground/Classifier/Dashborad/TrainingHistory.py @@ -2,11 +2,11 @@ ''' Create Date: 2023/09/11 Author: @1chooo(Hugo ChunHo Lin) -Version: v0.1.2 +Version: v0.1.4 ''' import gradio as gr -from Refinaid.gui.Information import PageContent +from Refinaid.Playground.Classifier.Information import PageContent from typing import Any, Tuple class TrainingHistoryComponent: diff --git a/Refinaid/Playground/Classifier/Example.py b/Refinaid/Playground/Classifier/Example.py index bdcf9b0..750948f 100644 --- a/Refinaid/Playground/Classifier/Example.py +++ b/Refinaid/Playground/Classifier/Example.py @@ -2,7 +2,7 @@ ''' Create Date: 2023/09/11 Author: @1chooo(Hugo ChunHo Lin) -Version: v0.1.2 +Version: v0.1.4 ''' import gradio as gr diff --git a/Refinaid/Playground/Classifier/Launch.py b/Refinaid/Playground/Classifier/Launch.py index 3d260de..6efdea5 100644 --- a/Refinaid/Playground/Classifier/Launch.py +++ b/Refinaid/Playground/Classifier/Launch.py @@ -2,18 +2,17 @@ ''' Create Date: 2023/09/11 Author: @1chooo(Hugo ChunHo Lin) -Version: v0.1.2 +Version: v0.1.4 ''' -import os import gradio as gr from Refinaid.Utils.Listener import background_listener -from Refinaid.gui.Information import PageContent -from Refinaid.gui.Dashborad.Header import PageHeader -from Refinaid.gui.Dashborad.Preprocessing import PreprocessingComponent -from Refinaid.gui.Dashborad.Training import TrainingComponent -from Refinaid.gui.Dashborad.TrainingHistory import TrainingHistoryComponent -from Refinaid.gui.Example import PreprocessingExample +from Refinaid.Playground.Classifier.Information import PageContent +from Refinaid.Playground.Classifier.Dashborad.Header import PageHeader +from Refinaid.Playground.Classifier.Dashborad.Preprocessing import PreprocessingComponent +from Refinaid.Playground.Classifier.Dashborad.Training import TrainingComponent +from Refinaid.Playground.Classifier.Dashborad.TrainingHistory import TrainingHistoryComponent +from Refinaid.Playground.Classifier.Example import PreprocessingExample from typing import Any def build_ui(*args: Any, **kwargs: Any) -> gr.Blocks: diff --git a/Refinaid/Utils/Listener.py b/Refinaid/Utils/Listener.py index 24f590b..b7a776a 100644 --- a/Refinaid/Utils/Listener.py +++ b/Refinaid/Utils/Listener.py @@ -45,7 +45,7 @@ def background_listener( train_img3, training_history, preprocessing_visulize_scatter_plot, - ) -> None: + ) -> None: selected_dataset_name.change( fn=update_parameters, inputs=selected_dataset_name,