Skip to content

Commit

Permalink
updating ML example and discover script
Browse files Browse the repository at this point in the history
  • Loading branch information
Divya Banesh committed Aug 21, 2024
1 parent 344c185 commit dd7937a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 26 deletions.
54 changes: 30 additions & 24 deletions examples/theater/MLResultAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
4 changes: 2 additions & 2 deletions pycinema/scripts/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit dd7937a

Please sign in to comment.