Update my_model/tabs/readme.md
Browse files- my_model/tabs/readme.md +10 -25
my_model/tabs/readme.md
CHANGED
@@ -3,43 +3,28 @@ Directory Overview: This directory contains all the atreamlit application pages:
|
|
3 |
|
4 |
################################################################
|
5 |
|
6 |
-
1. results.py
|
7 |
The results.py module manages the interactive Streamlit demo for visualizing model evaluation results and analysis. It provides an interface for users to explore different aspects of model performance and evaluation samples.
|
8 |
|
9 |
-
### Functions:
|
10 |
-
`run_demo()` -> None
|
11 |
-
The run_demo function sets up an interactive Streamlit interface that allows users to select and visualize various aspects of model evaluation results and analysis. Users can choose between evaluation results & analysis or view random evaluation samples.
|
12 |
-
|
13 |
### Notes
|
14 |
Ensure the necessary dependencies are installed and properly configured.
|
15 |
The `run_demo function` relies on the ResultDemonstrator class to generate plots and display results.
|
16 |
|
17 |
################################################################
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
The run_inference.py is responsible for the running inference and utilizing the fine-tuned models page. It manages the user interface and interactions for a Streamlit-based Knowledge-Based Visual Question Answering (KBVQA) application. This module handles image uploads, displays sample images, and facilitates the question-answering process using the KBVQA model.
|
22 |
-
|
23 |
-
### Class: InferenceRunner
|
24 |
|
25 |
-
|
26 |
-
The `InferenceRunner` class provides functionalities to manage the user interface for KBVQA, enabling users to upload images, select sample images, and ask questions about the images.
|
27 |
-
|
28 |
-
### Methods
|
29 |
-
- `__init__() -> None`: Initializes the InferenceRunner instance, setting up the necessary state.
|
30 |
-
- `answer_question(caption: str, detected_objects_str: str, question: str) -> Tuple[str, int]`: Generates an answer to a user's question based on the image's caption and detected objects.
|
31 |
-
- `display_sample_images() -> None`: Displays sample images as clickable thumbnails for the user to select.
|
32 |
-
- `handle_image_upload() -> None`: Provides an image uploader widget for the user to upload their own images.
|
33 |
-
- `display_image_and_analysis(image_key: str, image_data: Dict, nested_col21: DeltaGenerator, nested_col22: DeltaGenerator) -> None`: Displays the uploaded or selected image and provides an option to analyze the image.
|
34 |
-
- `handle_analysis_button(image_key: str, image_data: Dict, nested_col22: DeltaGenerator) -> None`: Provides an 'Analyze Image' button and processes the image analysis upon click.
|
35 |
-
- `handle_question_answering(image_key: str, image_data: Dict, nested_col22: DeltaGenerator) -> None`: Manages the question-answering interface for each image.
|
36 |
-
- `display_question_answering_interface(image_key: str, image_data: Dict, nested_col22: DeltaGenerator) -> None`: Displays the interface for question answering, including sample questions and a custom question input.
|
37 |
-
- `process_question(image_key: str, question: str, image_data: Dict, nested_col22: DeltaGenerator) -> None`: Processes the user's question, generates an answer, and updates the question-answer history.
|
38 |
-
- `image_qa_app() -> None`: Main application interface for image-based question answering.
|
39 |
-
- `run_inference() -> None`: Sets up widgets and manages the inference process, including model loading and reloading, based on user interactions.
|
40 |
|
41 |
### Notes
|
42 |
- Ensure the necessary dependencies are installed and properly configured.
|
43 |
- The `InferenceRunner` class relies on the KBVQA model to generate answers to questions based on image analysis.
|
44 |
|
45 |
################################################################
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
################################################################
|
5 |
|
6 |
+
## 1. results.py
|
7 |
The results.py module manages the interactive Streamlit demo for visualizing model evaluation results and analysis. It provides an interface for users to explore different aspects of model performance and evaluation samples.
|
8 |
|
|
|
|
|
|
|
|
|
9 |
### Notes
|
10 |
Ensure the necessary dependencies are installed and properly configured.
|
11 |
The `run_demo function` relies on the ResultDemonstrator class to generate plots and display results.
|
12 |
|
13 |
################################################################
|
14 |
|
15 |
+
## 2. run_inference.py
|
|
|
|
|
|
|
|
|
16 |
|
17 |
+
The run_inference.py is responsible for the running inference to test and use the fine-tuned models. It manages the user interface and interactions for a Streamlit-based Knowledge-Based Visual Question Answering (KBVQA) application. This module handles image uploads, displays sample images, and facilitates the question-answering process using the KBVQA model.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
### Notes
|
20 |
- Ensure the necessary dependencies are installed and properly configured.
|
21 |
- The `InferenceRunner` class relies on the KBVQA model to generate answers to questions based on image analysis.
|
22 |
|
23 |
################################################################
|
24 |
+
|
25 |
+
## 3. model_arch.py
|
26 |
+
|
27 |
+
The `model_arch.py` displays the model architecture and accompanying abstract and design details for the Knowledge-Based Visual Question Answering (KB-VQA) model.
|
28 |
+
|
29 |
+
################################################################
|
30 |
+
|