Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor UI changes in upload panel of model app #348

Merged
merged 30 commits into from
Apr 9, 2020
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
eb97ef1
Update segment.js
amritansh22 Mar 25, 2020
339bba0
Add feature to change class list
amritansh22 Mar 28, 2020
0b56ba6
Update model.js
amritansh22 Mar 31, 2020
4f2d83c
Update segment.js
amritansh22 Apr 4, 2020
2f9e8ee
Update segment.js
amritansh22 Apr 4, 2020
7a1d920
Update segment.js
amritansh22 Apr 4, 2020
7fc7928
Revert "Update segment.js"
amritansh22 Apr 4, 2020
b451c03
Revert "Update segment.js"
amritansh22 Apr 4, 2020
d3ba9e5
Revert "Update segment.js"
amritansh22 Apr 4, 2020
577bb55
Revert "Update model.js"
amritansh22 Apr 4, 2020
d292b5c
Update roi.png
amritansh22 Apr 4, 2020
7476c94
Revert "Update roi.png"
amritansh22 Apr 4, 2020
5edf104
Merge branch 'develop' of https://github.com/amritansh22/caMicroscope…
amritansh22 Apr 4, 2020
6f9648b
Revert "Merge branch 'develop' of https://github.com/amritansh22/caMi…
amritansh22 Apr 4, 2020
9c44cce
Revert "Revert "Merge branch 'develop' of https://github.com/amritans…
amritansh22 Apr 4, 2020
cc27cd4
Revert "Revert "Update roi.png""
amritansh22 Apr 4, 2020
89357e9
Revert "Revert "Revert "Update roi.png"""
amritansh22 Apr 4, 2020
61ab275
Update model.js
amritansh22 Apr 4, 2020
9ca92b9
Merge branch 'develop' of https://github.com/amritansh22/caMicroscope…
amritansh22 Apr 4, 2020
9325ab1
Update model.js
amritansh22 Apr 4, 2020
518de4e
Update model.js
amritansh22 Apr 4, 2020
0cb5f28
Update model.js
amritansh22 Apr 4, 2020
4f77f00
Update model.js
amritansh22 Apr 4, 2020
6d5b909
Update model.js
amritansh22 Apr 5, 2020
9b5c48b
Merge branch 'develop' of https://github.com/amritansh22/caMicroscope…
amritansh22 Apr 8, 2020
8dde51d
Minor UI changes in upload app panel of model app
amritansh22 Apr 8, 2020
6d12b8e
Minor UI changes in upload panel of model app
amritansh22 Apr 8, 2020
60d168b
Merge branch 'develop' of https://github.com/amritansh22/caMicroscope…
amritansh22 Apr 8, 2020
d6edaf8
Update model.js
amritansh22 Apr 8, 2020
4984b04
Update model.js
amritansh22 Apr 8, 2020
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
14 changes: 13 additions & 1 deletion apps/model/model.css
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,19 @@ ul.disabled {
#upload_panel .modalbox-content{
width: 30%;
}

.form-style [type=url]:focus,
.form-style input[type=text]:focus,
.form-style input[type=number]:focus
{
background-color: #ddd;
outline: none;
border:2px;
border-style: solid;
}
.form-style #modelupload,
.form-style #weightsupload{
cursor: pointer;
}
body{
color: black;
}
23 changes: 22 additions & 1 deletion apps/model/model.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const PDR = OpenSeadragon.pixelDensityRatio;
const IDB_URL = 'indexeddb://';
var csvContent;

var x = 5;
birm marked this conversation as resolved.
Show resolved Hide resolved
// INITIALIZE DB
window.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
// id(autoinc), name, location(name+id), classes
Expand Down Expand Up @@ -603,6 +603,14 @@ function runPredict(key) {
}
}

// Function to check if model name is repeated or not.
function checkNameDuplicate(name) {
if (namearray.indexOf(name)!=-1) {
return 1;
}
return 0;
}


// TO-DO: Allow uploading and using tensorflow graph models. Can't save graph models. Need to use right away.
function uploadModel() {
Expand Down Expand Up @@ -668,6 +676,7 @@ function uploadModel() {
status.innerHTML = 'Model with the same name already exists. Please choose a new name';
status.classList.remove('blink');
console.log(e);
document.getElementById("name").style = "border:2px; border-style: solid; border-color: red;";
return;
}

Expand All @@ -683,8 +692,20 @@ function uploadModel() {
'Please input values on which the model was trained.';
console.log(e);
status.classList.remove('blink');
document.getElementById("imageSize").style = "border:2px; border-style: solid; border-color: red;";
return;
}

try {
if (checkNameDuplicate(_name.value)) {
throw new Error('Model name repeated');
}
} catch (e) {
status.innerHTML = 'Model with the same name already exists. Please choose a new name';
status.classList.remove('blink');
return;
}
namearray.push(_name.value);

await model.save(IDB_URL + name);

Expand Down