Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NormanTUD committed Feb 22, 2024
1 parent 9b63d59 commit 504edae
Show file tree
Hide file tree
Showing 3 changed files with 432 additions and 277 deletions.
47 changes: 47 additions & 0 deletions debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,53 @@ async function debug_unusual_function_inputs () {
"_predict_error",
"_run_predict_and_show",
"_predict_image",
"_print_example_predictions",
"_get_resized_webcam",
"_predict_webcam_html",
"predict_webcam",
"show_prediction",
"show_or_hide_predictions",
"predict_table",
"_predict_table",
"_predict_table_row",
"number_of_elements_in_tensor_shape",
"__predict",
"tensor_shape_matches_model",
"_image_output_handdrawn",
"_predict_handdrawn",
"show_webcam",
"blobToBase64",
"getBase64",
"get_units_at_layer",
"restart_lenet",
"download_visualization",
"sprintf",
"update_translations",
"handle_file_select",
"get_nr_from_own_image_files",
"vsprintf",
"get_methods",
"random_two",
"html2canvas",
"jscolor",
"random",
"init_page_contents",
"Atrament",
"update_lang",
"_classification_handdrawn",
"dataset_already_there",
"draw_bars_or_numbers",
"_webcam_prediction_row",
"predict",
"get_index_of_highest_category",
"draw_heatmap",
"_webcam_predict_text",
"predict_webcam",
"draw_rgb",
"draw_multi_channel",
"_get_example_string_image",
"_print_predictions_text",
"_prepare_data",
"scaleNestedArray",
"_predict_result",
"predict_demo",
Expand Down
92 changes: 50 additions & 42 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,63 +280,71 @@ function init_set_all_options () {
}

async function init_page_contents (chosen_dataset) {
dbg("[init_page_contents] " + language[lang]["initializing_page_contents"]);
skip_predictions = true;
disabling_saving_status = true;
global_disable_auto_enable_valid_layer_types = true;
disable_show_python_and_create_model = true;
try {
dbg("[init_page_contents] " + language[lang]["initializing_page_contents"]);
skip_predictions = true;
disabling_saving_status = true;
global_disable_auto_enable_valid_layer_types = true;
disable_show_python_and_create_model = true;

$("#width").val(width);
$("#height").val(height);
$("#width").val(width);
$("#height").val(height);

await init_dataset_category();
global_disable_auto_enable_valid_layer_types = true;
await init_dataset_category();
global_disable_auto_enable_valid_layer_types = true;

try {
document.getElementById("upload_x_file").addEventListener("change", handle_x_file, false);
document.getElementById("upload_y_file").addEventListener("change", handle_y_file, false);
document.getElementById("upload_model").addEventListener("change", upload_model, false);
} catch (e) {
if(Object.keys(e).includes("message")) {
e = e.message;
try {
document.getElementById("upload_x_file").addEventListener("change", handle_x_file, false);
document.getElementById("upload_y_file").addEventListener("change", handle_y_file, false);
document.getElementById("upload_model").addEventListener("change", upload_model, false);
} catch (e) {
if(Object.keys(e).includes("message")) {
e = e.message;
}

err("" + e);
}

err("" + e);
}
await determine_input_shape();

await determine_input_shape();
$("#layers_container").sortable({
placeholder: "sortable_placeholder",
axis: "y",
opacity: 0.6,
revert: true,
update: function( ) {
updated_page(); // cannot be async
}
});

$("#layers_container").sortable({
placeholder: "sortable_placeholder",
axis: "y",
opacity: 0.6,
revert: true,
update: function( ) {
updated_page(); // cannot be async
}
});
$("#tablist").show();

$("#tablist").show();
is_setting_config = false;

is_setting_config = false;
global_disable_auto_enable_valid_layer_types = false;
disable_show_python_and_create_model = false;

global_disable_auto_enable_valid_layer_types = false;
disable_show_python_and_create_model = false;
if(chosen_dataset) {
$("#dataset").val(chosen_dataset).trigger("change");
} else {
await set_config();
}

if(chosen_dataset) {
$("#dataset").val(chosen_dataset).trigger("change");
} else {
await set_config();
}
rename_tmp_onchange();

rename_tmp_onchange();
await updated_page();

await updated_page();
disabling_saving_status = false;
skip_predictions = false;

disabling_saving_status = false;
skip_predictions = false;
hide_dataset_when_only_one();
} catch (e) {
if(Object.keys(e).includes("message")) {
e = e.message;
}

hide_dataset_when_only_one();
assert(false, e);
}
}

function dataset_already_there (dataset_name) {
Expand Down
Loading

0 comments on commit 504edae

Please sign in to comment.