Skip to content

Commit 165c3ff

Browse files
committed
Update README
1 parent fd25c4f commit 165c3ff

File tree

6 files changed

+1108
-981
lines changed

6 files changed

+1108
-981
lines changed

.github/workflows/run-workflow-tests.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,30 @@ on:
1010
jobs:
1111
build-and-run:
1212
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
python-version: ["3.9", "3.10", "3.11"]
1317
env:
1418
TEST_XIRCUITS: |
1519
examples/TFKerasTrainImageClassifier.xircuits
1620
examples/TFKerasModelPredict.xircuits
17-
21+
1822
steps:
1923
- name: Checkout Repository
2024
uses: actions/checkout@v3
2125

22-
- name: Install xircuits
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Create virtual environment
32+
run: |
33+
python -m venv venv
34+
echo "${{ github.workspace }}/venv/bin" >> $GITHUB_PATH
35+
36+
- name: Install xircuits in virtual environment
2337
run: pip install xircuits
2438

2539
- name: Set Environment Variables
@@ -35,7 +49,7 @@ jobs:
3549
fi
3650
3751
- name: List Xircuits
38-
run: xircuits list
52+
run: xircuits list
3953

4054
- name: Clone Repository
4155
run: |
@@ -55,7 +69,7 @@ jobs:
5569
else
5670
echo "requirements.txt not found."
5771
fi
58-
72+
5973
- name: Test .xircuits Workflows
6074
run: |
6175
export PYTHONPATH="${GITHUB_WORKSPACE}:${PYTHONPATH}"
@@ -101,5 +115,5 @@ jobs:
101115
if: always()
102116
uses: actions/upload-artifact@v4
103117
with:
104-
name: ${{ env.LIBRARY_NAME }}-validation-workflow
118+
name: ${{ env.LIBRARY_NAME }}-validation-workflow-${{ matrix.python-version }}
105119
path: ${{ github.workspace }}/workflow_logs.txt

README.md

Lines changed: 107 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,126 @@
1-
# Xircuits Comprehensive Keras Library
1+
<p align="center">
2+
<a href="https://github.com/XpressAI/xircuits/tree/master/xai_components#xircuits-component-library-list">Component Libraries</a> •
3+
<a href="https://github.com/XpressAI/xircuits/tree/master/project-templates#xircuits-project-templates-list">Project Templates</a>
4+
<br>
5+
<a href="https://xircuits.io/">Docs</a> •
6+
<a href="https://xircuits.io/docs/Installation">Install</a> •
7+
<a href="https://xircuits.io/docs/category/tutorials">Tutorials</a> •
8+
<a href="https://xircuits.io/docs/category/developer-guide">Developer Guides</a> •
9+
<a href="https://github.com/XpressAI/xircuits/blob/master/CONTRIBUTING.md">Contribute</a> •
10+
<a href="https://www.xpress.ai/blog/">Blog</a> •
11+
<a href="https://discord.com/invite/vgEg2ZtxCw">Discord</a>
12+
</p>
213

3-
This comprehensive library for Xircuits encompasses a wide range of functionalities involving Keras datasets, model management, model instantiation, prediction, and transfer learning. It's designed to facilitate various machine learning tasks within the Xircuits visual programming interface.
414

5-
### Prerequisites
615

7-
- Python 3.8 or higher
8-
- TensorFlow 2.x
916

10-
### Installation
1117

12-
```bash
13-
xircuits install tensorflow_keras
14-
```
18+
<p align="center"><i>Xircuits Component Library to interface with TensorFlow Keras! Build and deploy deep learning solutions with ease.</i></p>
1519

16-
You may also install it manually via
20+
---
21+
## Xircuits Component Library for TensorFlow Keras
22+
23+
Integrates TensorFlow Keras into Xircuits for streamlined deep learning workflows. Simplifies model design, training, and deployment with reusable components. Reduces complexity and accelerates development for scalable AI solutions.
24+
25+
## Table of Contents
26+
27+
- [Preview](#preview)
28+
29+
- [Prerequisites](#prerequisites)
30+
- [Main Xircuits Components](#main-xircuits-components)
31+
- [Try The Examples](#try-the-examples)
32+
- [Installation](#installation)
33+
34+
## Preview
35+
36+
### TFKerasTransferLearning Example
37+
38+
![TFKerasTransferLearning](https://github.com/user-attachments/assets/8719a3c1-76a6-49a5-8cd2-6c22d9abbf6c)
39+
40+
41+
### TFKerasTransferLearning Result
42+
43+
![TFKerasTransferLearning](https://github.com/user-attachments/assets/a617cdb2-3af7-47a6-a3d4-593eefd18c68)
44+
45+
46+
### TFKerasTrainImageClassifier Example
47+
48+
![TFKerasTrainImageClassifier](https://github.com/user-attachments/assets/e85d5f65-470f-42c3-ab85-9795ba05bcb7)
49+
50+
51+
### TFKerasTrainImageClassifier Result
52+
53+
<img src="https://github.com/user-attachments/assets/6fd41596-aa0e-45bd-98e2-34b2baf0b5dd" alt="TFKerasTrainImageClassifier_Result" />
54+
55+
### TFKerasModelPredict Example
56+
57+
![TFKerasModelPredict](https://github.com/user-attachments/assets/71952d43-23d2-49ea-bcab-b68b9b894510)
1758

18-
```bash
19-
pip install -r requirements.txt
20-
```
2159

22-
## Keras Dataset and Model Management
60+
### TFKerasModelPredict Result
2361

24-
For tasks from dataset preparation to model training and evaluation.
62+
<img src="https://github.com/user-attachments/assets/c9b863b4-6b66-42a2-94a3-0c9d027dec9a" alt="TFKerasModelPredict_result" />
2563

26-
### Components
2764

28-
- **`ReadKerasDataSet`**: Loads Keras datasets or creates datasets from directories. Supports MNIST, CIFAR-10/100, and custom datasets.
29-
- **`FlattenImageData`**: Converts 2D dataset tuples to 1D, suitable for 1D neural networks.
30-
- **`TrainTestSplit`**: Splits datasets into training and testing sets with configurable parameters.
31-
- **`KerasCreate1DInputModel`**: Creates 1D Keras models for 1D input datasets.
32-
- **`KerasCreate2DInputModel`**: Assembles 2D Keras models, perfect for image-based datasets.
33-
- **`KerasTrainImageClassifier`**: Trains Keras models for image classification.
34-
- **`KerasEvaluateAccuracy`**: Evaluates Keras models against datasets for accuracy and loss.
35-
- **`ShouldStop`**: Decides if training should stop based on accuracy targets or max retries.
36-
- **`SaveKerasModel`**: Saves Keras models as `.h5` files for later use.
65+
## Prerequisites
3766

38-
## Keras Model Instantiation and Prediction
67+
Before you begin, you will need the following:
3968

40-
These components support a range of model architectures for image classification.
69+
1. Python3.9+.
70+
2. Xircuits.
4171

42-
### Components
72+
## Main Xircuits Components
4373

44-
- **`LoadKerasModel`**: Loads Keras models with customizable configurations.
45-
- **`KerasPredict`**: Performs predictions with Keras models on images.
46-
- **`ResNet50`, `ResNet101`, `ResNet152`**: Instantiates various ResNet models with customizable configurations.
47-
- **`VGG16`, `VGG19`**: Provides VGG model architectures for image classification.
48-
- **`Xception`**: Implements the Xception architecture for image classification.
49-
- **`MobileNet`**: Offers MobileNet architecture with adjustable parameters.
74+
### KerasCreate1DInputModel:
75+
Creates 1D Keras models for datasets with 1D input structures.
5076

51-
## TensorFlow Keras Transfer Learning
77+
<img src="https://github.com/user-attachments/assets/cf3c5bf4-b2ea-48e3-b964-e3fe2dbffd38" alt="KerasCreate1DInputModel" width="200" height="75" />
5278

53-
Designed for easy integration into Xircuits workflows for transfer learning scenarios, suitable for both beginners and experienced ML practitioners.
5479

55-
### Components
80+
### KerasCreate2DInputModel:
81+
Assembles 2D Keras models, ideal for image-based datasets.
5682

57-
- **`KerasTransferLearningModel`**: Fetches TensorFlow Keras Models for transfer learning.
58-
- **`TFDataset`**: Retrieves datasets from TensorFlow Datasets.
59-
- **`TrainKerasModel`**: Trains compiled Keras models with training data.
60-
- **`TFDSEvaluateAccuracy`**: Evaluates Keras models' accuracy using TensorFlow Datasets.
61-
- **`KerasModelCompiler`**: Compiles TensorFlow Keras models with custom configurations.
62-
- **`SaveKerasModel`**: Saves TensorFlow Keras models for future use.
83+
<img src="https://github.com/user-attachments/assets/def84826-5549-4de4-90c2-d01eaad9dc36" alt="KerasCreate2DInputModel" width="200" height="75" />
84+
85+
### KerasTransferLearningModel:
86+
Fetches TensorFlow Keras Models for transfer learning.
87+
88+
<img src="https://github.com/user-attachments/assets/5b98def2-87fe-4a92-8680-a2a5822210d6" alt="KerasTransferLearningModel" width="200" height="250" />
89+
90+
### KerasTrainImageClassifier:
91+
Trains Keras models for image classification tasks.
92+
93+
### KerasEvaluateAccuracy:
94+
Evaluates Keras models for accuracy and loss using test datasets.
95+
96+
### TrainKerasModel:
97+
Trains compiled Keras models with training data.
98+
99+
## Try The Examples
100+
101+
We have provided an example workflow to help you get started with the TensorFlow Keras component library. Give it a try and see how you can create custom TensorFlow Keras components for your applications.
102+
103+
### TFKerasTransferLearning
104+
105+
Demonstrates transfer learning with MobileNetV2 pre-trained on ImageNet to classify the "cats_vs_dogs" dataset, evaluate accuracy, and save the model.
106+
107+
### TFKerasTrainImageClassifier
108+
109+
This workflow trains a 2D convolutional model on a dataset, evaluates its accuracy, and demonstrates basic image classification.
110+
111+
### TFKerasModelPredict
112+
113+
Uses the pre-trained ResNet50 model to classify an input image and predict its class label.
114+
115+
## Installation
116+
To use this component library, ensure that you have an existing [Xircuits setup](https://xircuits.io/docs/main/Installation). You can then install the TensorFlow Keras library using the [component library interface](https://xircuits.io/docs/component-library/installation#installation-using-the-xircuits-library-interface), or through the CLI using:
117+
118+
```
119+
xircuits install tensorflow_keras
120+
```
121+
You can also do it manually by cloning and installing it:
122+
```
123+
# base Xircuits directory
124+
git clone https://github.com/XpressAI/xai-tensorflow-keras xai_components/xai_tensorflow_keras
125+
pip install -r xai_components/xai_tensorflow_keras/requirements.txt
126+
```

0 commit comments

Comments
 (0)