Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
819f7b1
Update index.html
odina-1ai Jul 25, 2023
0ecf117
Update index.html
odina-1ai Jul 25, 2023
5fd5642
index.html
damnhenny Jul 25, 2023
9f52156
styles.css
damnhenny Jul 25, 2023
9fd1070
Update index.html
odina-1ai Jul 25, 2023
7d8999f
Merge pull request #3 from damnhenny/patch-2
odina-1ai Jul 25, 2023
a60ed07
Merge pull request #2 from damnhenny/patch-1
odina-1ai Jul 25, 2023
a6cb98b
Merge branch 'main' into websiteedits
odina-1ai Jul 25, 2023
03f118a
Update index.html
odina-1ai Jul 25, 2023
483fcad
Update index.js
odina-1ai Jul 25, 2023
2f2b355
index.js
damnhenny Jul 25, 2023
35db285
Merge pull request #1 from odina-1ai/websiteedits
odina-1ai Jul 25, 2023
870bfb5
Merge branch 'main' into patch-3
odina-1ai Jul 25, 2023
1468b04
Merge pull request #4 from damnhenny/patch-3
odina-1ai Jul 25, 2023
f94792c
Update index.js
damnhenny Jul 25, 2023
f21b7e7
Merge pull request #5 from damnhenny/patch-4
odina-1ai Jul 25, 2023
802dbc3
Add files via upload
odina-1ai Jul 25, 2023
fa2629d
Update index.html
odina-1ai Jul 25, 2023
977a4b4
Update index.html
odina-1ai Jul 26, 2023
ee66963
Merge branch 'websiteedits' into main
odina-1ai Jul 26, 2023
1d9726b
Merge pull request #6 from odina-1ai/main
odina-1ai Jul 26, 2023
2e5450a
Update styles.css
odina-1ai Jul 26, 2023
97d301d
Update index.html
odina-1ai Jul 26, 2023
bcd9f87
Update index.html
odina-1ai Jul 26, 2023
63d3724
Update index.js
odina-1ai Jul 26, 2023
e1991f2
Update index.html
damnhenny Jul 26, 2023
25ba196
Update index.js
odina-1ai Jul 26, 2023
08725a7
Update model.json
odina-1ai Jul 26, 2023
9be01c7
Update README.md
odina-1ai Jul 26, 2023
917adcd
Update index.js
damnhenny Jul 26, 2023
4bc613a
Update index.js
odina-1ai Jul 26, 2023
08667cc
Create modelcard.html
odina-1ai Jul 26, 2023
47fdcf6
Create modelcard.html
odina-1ai Jul 26, 2023
416a68d
Create data.json
damnhenny Jul 26, 2023
9b9d3d7
Merge pull request #7 from damnhenny/patch-7
odina-1ai Jul 26, 2023
a695d6e
Merge pull request #9 from damnhenny/patch-5
odina-1ai Jul 26, 2023
f754a50
Merge pull request #8 from damnhenny/patch-6
odina-1ai Jul 26, 2023
3460f66
Add files via upload
odina-1ai Jul 26, 2023
0c511bd
Delete group1-shard1of4.bin
odina-1ai Jul 26, 2023
6849ed7
Delete group1-shard2of4.bin
odina-1ai Jul 26, 2023
073c85e
Delete group1-shard3of4.bin
odina-1ai Jul 26, 2023
6ffc50d
Delete group1-shard4of4.bin
odina-1ai Jul 26, 2023
5bbdf0d
Update model.json
odina-1ai Jul 26, 2023
656136d
Update index.js
odina-1ai Jul 26, 2023
83ea9fb
Update index.js
damnhenny Jul 26, 2023
770464c
Merge pull request #10 from damnhenny/patch-8
odina-1ai Jul 26, 2023
204112d
Update index.js
damnhenny Jul 26, 2023
03005ad
Add files via upload
odina-1ai Jul 26, 2023
d82b7f8
Merge pull request #11 from damnhenny/patch-9
odina-1ai Jul 26, 2023
7bd6211
Add files via upload
odina-1ai Jul 26, 2023
52f0963
Update index.js
damnhenny Jul 26, 2023
f77d620
Update modelcard.html
odina-1ai Jul 26, 2023
53a111c
Merge pull request #12 from damnhenny/patch-10
odina-1ai Jul 26, 2023
db83ed1
Update modelcard.html
odina-1ai Jul 26, 2023
35d3a2e
Update index.js
damnhenny Jul 26, 2023
e27ab3f
Merge pull request #13 from damnhenny/patch-11
odina-1ai Jul 26, 2023
2c0e355
Update index.html
odina-1ai Jul 27, 2023
fcf50da
Merge branch 'main' into websiteedits
odina-1ai Jul 27, 2023
1e828dd
Update index.html
odina-1ai Jul 27, 2023
874a7da
Add files via upload
odina-1ai Jul 27, 2023
1575d2f
Update index.html
odina-1ai Jul 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Project Classification + X

[See this example live!](https://dkguo.github.io/classification-web-template/)
[See this example live!](https://odina-1ai.github.io/classification-web-templateORA/)



This is a template website to host a TensorFlow JS (TFJS) version of image classification models online.

Expand Down
522 changes: 522 additions & 0 deletions data.json

Large diffs are not rendered by default.

Binary file added dataset-cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 19 additions & 32 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,51 +14,36 @@
limitations under the License.
==============================================================================
-->

<!-- commit test -->
<!doctype html>

<head>
<title>Project Classification+X</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="shared/tfjs-examples.css" />
</head>

<style>
.pred-container {
margin-bottom: 20px;
}

.pred-container > div {
display: inline-block;
margin-right: 20px;
vertical-align: top;
}

.row {
display: table-row;
}
.cell {
display: table-cell;
padding-right: 20px;
}

#file-container {
margin-bottom: 20px;
}
</style>

<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flowa-dex</title>
<link rel="icon" href="favicon-16x16.png">
<link rel="stylesheet" href="shared/tfjs-examples.css"/>
<link rel="stylesheet" href="styles.css">


</head>

<body>
<div class="tfjs-example-container">
<section class='title-area'>
<h1>Fruits and Veggies Classification</h1>
<h1>Flower Classification</h1>
</section>

<section>
<img src="dataset.jpg" style="width: 50%;">
<img src="dataset-cover.png" style="width: 50%;">
<p class='section-head'>Description</p>
<!-- new model card code here -->
<p>
We classify 9 categories of fruits and veggies.
Identifies species of flower in an image and provides information on the edibility of that flower.
(want me to add a general statement about the model here as well?)
</p>
</section>

Expand All @@ -70,6 +55,8 @@ <h1>Fruits and Veggies Classification</h1>
<section>
<p class='section-head'>Model Output</p>

<div id="output-container"></div>

<div id="file-container" style="display: none">
Upload an image: <input type="file" id="files" name="files[]" multiple />
</div>
Expand Down
150 changes: 135 additions & 15 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,121 @@
* =============================================================================
*/
const CLASSES_NAMES = {
0: 'apple',
1: 'avocado',
2: 'banana',
3: 'carrot',
4: 'lettuce',
5: 'onion',
6: 'pepper',
7: 'potato',
8: 'tomato',

0: 'Alpine sea holly',
1: 'Anthurium',
2: 'Artichoke',
3: 'Azalea',
4: 'Balloon Flower',
5: 'Barberton Daisy',
6: 'Bee Balm',
7: 'Bird of paradise',
8: 'Bishop of llandaf',
9: 'Black-eyed susan',
10: 'Blackberry lily',
11: 'Blanket Flower',
12: 'Bolero deep blue',
13: 'Bougainvillea',
14: 'Bromelia',
15: 'Buttercup',
16: 'Californian poppy',
17: 'Camellia',
18: 'Canna lily',
19: 'Canterbury bells',
20: 'Cape flower',
21: 'Carnation',
22: 'Cautleya Spicata',
23: 'Clematis',
24: 'Colts foot',
25: 'Columbine',
26: 'Common dandelian',
27: 'Common tulip',
28: 'Corn poppy',
29: 'Cosmos',
30: 'Cyclamen',
31: 'Daffodil',
32: 'Daisy',
33: 'Desert-rose',
34: 'Fire lily',
35: 'Foxglove',
36: 'Frangipani',
37: 'Fritillary',
38: 'Garden phlox',
39: 'Gaura',
40: 'Gazania',
41: 'Geranium',
42: 'Giant white arum lily',
43: 'Globe thistle',
44: 'Globe-flower',
45: 'Grape hyacinth',
46: 'Great masterwort',
47: 'Hard-leaved pocket orchid',
48: 'Hibiscus',
49: 'Hippeastrum',
50: 'Iris',
51: 'Japanese anemone',
52: 'King protea',
53: 'Lenten rose',
54: 'Lilac hibiscus',
55: 'Lotus',
56: 'Love in the mist',
57: 'Magnolia',
58: 'Mallow',
59: 'Marigold',
60: 'Mexican petunia',
61: 'Monkshood',
62: 'Moon orchid',
63: 'Morning glory',
64: 'Orange dahlia',
65: 'Osteospermum',
66: 'Passion flower',
67: 'Peruvian lily',
68: 'Petunia',
69: 'Pincushion flower',
70: 'Pink primrose',
71: 'Pink quill',
72: 'Pink-yellow dahlia',
73: 'Poinsettia',
74: 'Primula',
75: 'Prince of wales feathers',
76: 'Purple coneflower',
77: 'Red ginger',
78: 'Rose',
79: 'Ruby-lipped cattleya',
80: 'Siam tulip',
81: 'Silverbush',
82: 'Snapdragon',
83: 'Spear thistle',
84: 'Spring crocus',
85: 'Stemless gentian',
86: 'Sunflower',
87: 'Sweet pea',
88: 'Sweet william',
89: 'Sword lily',
90: 'Thorn apple',
91: 'Tiger lily',
92: 'Toad lily',
93: 'Tree mallow',
94: 'Tree poppy',
95: 'Trumpet creeper',
96: 'Wallflower',
97: 'Water lily',
98: 'Watercress',
99: 'Wild geranium',
100: 'Wild pansy',
101: 'Wild rose',
102: 'Windflower',
103: 'Yellow iris',



}

const MOBILENET_MODEL_PATH =
// tslint:disable-next-line:max-line-length
'model_tfjs';

const IMAGE_SIZE = 128;
const IMAGE_SIZE = 224;
const TOPK_PREDICTIONS = 3;

let mobilenet;
Expand Down Expand Up @@ -159,16 +258,25 @@ function showResults(imgElement, classes) {
classElement.innerText = classes[i].className;
row.appendChild(classElement);

// const predElement = document.createElement('div');
// classElement.className = 'cell';
// classElement.innerText = classes[i].pred;
// row.appendChild(classElement);

const probsElement = document.createElement('div');
probsElement.className = 'cell';
probsElement.innerText = classes[i].probability.toFixed(3);
row.appendChild(probsElement);

// const predElement = document.createElement('div');
// classElement.className = 'cell';
// classElement.innerText = classes[i].pred;
// row.appendChild(classElement);
var description = "";
for (var j = 0; j < jsonData.length; j++){
if (jsonData[j]["Flower Type"] === classes[i].className) {
description = jsonData[j]["Description"];}
}
const descriptionElement = document.createElement('div');
descriptionElement.className = 'cell';
descriptionElement.innerText = description;
row.appendChild(descriptionElement);

probsContainer.appendChild(row);
}
predictionContainer.appendChild(probsContainer);
Expand Down Expand Up @@ -207,3 +315,15 @@ const status = msg => demoStatusElement.innerText = msg;
const predictionsElement = document.getElementById('predictions');

mobilenetDemo();

async function fetchJSONData() {
try {
const response = await fetch('data.json');
jsonData = await response.json();
console.log('JSON data:', jsonData);
mobilenetDemo();
} catch (error) {
console.error('Error fetching JSON data:', error);
}
}
fetchJSONData();
Binary file added model_tfjs/group1-shard10of20.bin
Binary file not shown.
Binary file added model_tfjs/group1-shard11of20.bin
Binary file not shown.
Binary file added model_tfjs/group1-shard12of20.bin
Binary file not shown.
Binary file added model_tfjs/group1-shard13of20.bin
Binary file not shown.
Binary file added model_tfjs/group1-shard14of20.bin
Binary file not shown.
Binary file added model_tfjs/group1-shard15of20.bin
Binary file not shown.
Binary file added model_tfjs/group1-shard16of20.bin
Binary file not shown.
Binary file added model_tfjs/group1-shard17of20.bin
Binary file not shown.
Binary file added model_tfjs/group1-shard18of20.bin
Binary file not shown.
Binary file added model_tfjs/group1-shard19of20.bin
Binary file not shown.
Binary file added model_tfjs/group1-shard1of20.bin
Binary file not shown.
Binary file removed model_tfjs/group1-shard1of4.bin
Binary file not shown.
Binary file added model_tfjs/group1-shard20of20.bin
Binary file not shown.
Binary file added model_tfjs/group1-shard2of20.bin
Binary file not shown.
Binary file removed model_tfjs/group1-shard2of4.bin
Binary file not shown.
Binary file added model_tfjs/group1-shard3of20.bin
Binary file not shown.
Binary file removed model_tfjs/group1-shard3of4.bin
Binary file not shown.
Binary file added model_tfjs/group1-shard4of20.bin
Binary file not shown.
Binary file removed model_tfjs/group1-shard4of4.bin
Binary file not shown.
Binary file added model_tfjs/group1-shard5of20.bin
Binary file not shown.
Binary file added model_tfjs/group1-shard6of20.bin
Binary file not shown.
Binary file added model_tfjs/group1-shard7of20.bin
Binary file not shown.
Binary file added model_tfjs/group1-shard8of20.bin
Binary file not shown.
Binary file added model_tfjs/group1-shard9of20.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion model_tfjs/model.json

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions modelcard.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!-- Model Card Draft

/////template link: https://huggingface.co/docs/hub/model-cards
/////ADD HTML TAGS

(Possible name: Flowadex, Flowa-dex(not taken or copyright)) -->

<h1>Model Title: Flower Identification Model</h1>
<h2>Project Title: Rubber Duckies Model Card</h2>


<p class = 'section-head'> Purpose:</p>
<p> Meant to be used as an educational tool for users to determine whether flowers are posionous or not. <p>
<p class = 'section-head'</p>
<p> Current limitations: Flowers can be both posionous and edible, depending on dosage.
- certain parts of flowers can be poisonous and other parts are not( are these concerns still relevant???) </p>

<p>(What type of neural network/model? What functions are being used? One's binary and one's an image
classifier???) - Classification Model <br><br>

Hyperparameters:<br>
Batch Size:<br>
Epochs:<br>
Learning Rate:<br><br>

Datasets used to train the model: 104 Flowers: Garden of Eden Kaggle Dataset<br>
104 Classes<br>
224x224x3 (what type of file? jpg? jpeg? png) Images<br>
- 104 Training Images<br>
- 7382 Test Images<br>
- 104 Validation Images<br><br>

(More details about images we choose to take around campus PLEASE)<br>
https://www.kaggle.com/datasets/msheriey/104-flowers-garden-of-eden<br><br>

Training Results: <br>
Testing Results:<br>
Validation Results:<br><br>

(Cite the Model Card Template Here so we don't get sued...) </p>
23 changes: 23 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

.pred-container {
margin-bottom: 20px;
}

.pred-container > div {
display: inline-block;
margin-right: 20px;
vertical-align: top;
}

.row {
display: table-row;
}
.cell {
display: table-cell;
padding-right: 20px;
}

#file-container {
margin-bottom: 20px;
}