From dd7937a8a1ca97476ea47dd1ab77418bd624e524 Mon Sep 17 00:00:00 2001 From: Divya Banesh Date: Wed, 21 Aug 2024 13:40:35 -0600 Subject: [PATCH] updating ML example and discover script --- examples/theater/MLResultAnalysis.py | 54 +++++++++++++++------------- pycinema/scripts/discover.py | 4 +-- 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/examples/theater/MLResultAnalysis.py b/examples/theater/MLResultAnalysis.py index 310485cd..1ae76092 100644 --- a/examples/theater/MLResultAnalysis.py +++ b/examples/theater/MLResultAnalysis.py @@ -4,19 +4,19 @@ import pycinema.theater.views # pycinema settings -PYCINEMA = { 'VERSION' : '2.1.0'} +PYCINEMA = { 'VERSION' : '3.0.0'} # filters CinemaDatabaseReader_0 = pycinema.filters.CinemaDatabaseReader() ImageReader_0 = pycinema.filters.ImageReader() MLTFReader_0 = pycinema.filters.MLTFReader() MLTFPredictor_0 = pycinema.filters.MLTFPredictor() +ImageView_0 = pycinema.filters.ImageView() ImagesToTable_0 = pycinema.filters.ImagesToTable() TableView_0 = pycinema.filters.TableView() PlotLineItem_0 = pycinema.filters.PlotLineItem() Plot_0 = pycinema.filters.Plot() -ImageView_0 = pycinema.filters.ImageView() -ImageView_1 = pycinema.filters.ImageView() +ImageView_2 = pycinema.filters.ImageView() # properties CinemaDatabaseReader_0.inputs.path.set("data/mnist.cdb", False) @@ -27,41 +27,47 @@ MLTFReader_0.inputs.path.set("data/MNIST_models/TF/mnist_tf.h5", False) MLTFPredictor_0.inputs.trainedModel.set(MLTFReader_0.outputs.model, False) MLTFPredictor_0.inputs.images.set(ImageReader_0.outputs.images, False) +ImageView_0.inputs.images.set(ImageReader_0.outputs.images, False) +ImageView_0.inputs.selection.set([], False) ImagesToTable_0.inputs.images.set(MLTFPredictor_0.outputs.images, False) TableView_0.inputs.table.set(ImagesToTable_0.outputs.table, False) TableView_0.inputs.selection.set([], False) PlotLineItem_0.inputs.table.set(ImagesToTable_0.outputs.table, False) PlotLineItem_0.inputs.x.set("TrueValue", False) -PlotLineItem_0.inputs.y.set("PredictedValue", False) +PlotLineItem_0.inputs.y.set("PredictedValue_0", False) PlotLineItem_0.inputs.fmt.set("ro", False) PlotLineItem_0.inputs.style.set({}, False) Plot_0.inputs.items.set(PlotLineItem_0.outputs.item, False) Plot_0.inputs.dpi.set(100, False) -ImageView_0.inputs.images.set(Plot_0.outputs.images, False) -ImageView_0.inputs.selection.set([], False) -ImageView_1.inputs.images.set(ImageReader_0.outputs.images, False) -ImageView_1.inputs.selection.set([], False) +ImageView_2.inputs.images.set(Plot_0.outputs.images, False) +ImageView_2.inputs.selection.set([], False) # layout -tabFrame1 = pycinema.theater.TabFrame() +tabFrame0 = pycinema.theater.TabFrame() +splitFrame0 = pycinema.theater.SplitFrame() +splitFrame0.setHorizontalOrientation() +view0 = pycinema.theater.views.NodeEditorView() +splitFrame0.insertView( 0, view0 ) +splitFrame0.setSizes([1018]) +tabFrame0.insertTab(0, splitFrame0) +tabFrame0.setTabText(0, 'Layout 1') splitFrame1 = pycinema.theater.SplitFrame() splitFrame1.setHorizontalOrientation() -view1 = pycinema.theater.views.NodeEditorView() -splitFrame1.insertView( 0, view1 ) -splitFrame1.setSizes([1018]) -tabFrame1.insertTab(0, splitFrame1) -tabFrame1.setTabText(0, 'Layout 1') splitFrame2 = pycinema.theater.SplitFrame() -splitFrame2.setHorizontalOrientation() -view2 = pycinema.theater.views.FilterView( ImageView_1 ) -splitFrame2.insertView( 0, view2 ) -view3 = pycinema.theater.views.FilterView( ImageView_0 ) -splitFrame2.insertView( 1, view3 ) -splitFrame2.setSizes([506, 505]) -tabFrame1.insertTab(1, splitFrame2) -tabFrame1.setTabText(1, 'Layout 3') -tabFrame1.setCurrentIndex(1) -pycinema.theater.Theater.instance.setCentralWidget(tabFrame1) +splitFrame2.setVerticalOrientation() +view4 = pycinema.theater.views.FilterView( ImageView_0 ) +splitFrame2.insertView( 0, view4 ) +view7 = pycinema.theater.views.FilterView( TableView_0 ) +splitFrame2.insertView( 1, view7 ) +splitFrame2.setSizes([292, 508]) +splitFrame1.insertView( 0, splitFrame2 ) +view8 = pycinema.theater.views.FilterView( ImageView_2 ) +splitFrame1.insertView( 1, view8 ) +splitFrame1.setSizes([506, 505]) +tabFrame0.insertTab(1, splitFrame1) +tabFrame0.setTabText(1, 'Layout 2') +tabFrame0.setCurrentIndex(1) +pycinema.theater.Theater.instance.setCentralWidget(tabFrame0) # execute pipeline CinemaDatabaseReader_0.update() diff --git a/pycinema/scripts/discover.py b/pycinema/scripts/discover.py index f540b51c..bf40cb14 100644 --- a/pycinema/scripts/discover.py +++ b/pycinema/scripts/discover.py @@ -42,13 +42,13 @@ ParallelCoordinates_0.inputs.table.set(TableQuery_0.outputs.table, False) ParallelCoordinates_0.inputs.ignore.set(['^file', '^id'], False) ParallelCoordinates_0.inputs.selection.set(ValueSource_0.outputs.value, False) -ImageReader_1.inputs.table.set(TableView_0.outputs.tableSelection, False) +ImageReader_1.inputs.table.set(TableView_0.outputs.table, False) ImageReader_1.inputs.file_column.set("FILE", False) ImageReader_1.inputs.cache.set(True, False) ImageView_1.inputs.images.set(ImageReader_1.outputs.images, False) ImageView_1.inputs.selection.set([], False) ValueSource_0.inputs.value.set(selected, False) -TableView_1.inputs.table.set(TableView_0.outputs.tableSelection, False) +TableView_1.inputs.table.set(TableView_0.outputs.table, False) TableView_1.inputs.selection.set([], False) TableQuery_0.inputs.table.set(CinemaDatabaseReader_0.outputs.table, False) TableQuery_0.inputs.sql.set(read_filter, False)