-
Notifications
You must be signed in to change notification settings - Fork 1
/
flow.py
49 lines (36 loc) · 1.25 KB
/
flow.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import socket
import numpy as np
import vigra
import pyqtgraph as pg
from pyqtgraph.Qt import QtGui, QtCore
from ivigraph import IViGrahp
hname = socket.gethostname()
app = QtGui.QApplication([])
print "host name ",hname
if hname=='Beethoven':
data = vigra.readImage('/home/phil/Downloads/lena512.bmp')
batchMode=False
if hname=='tbeier-A780GM-A':
data = vigra.readImage('/home/tbeier/Desktop/lena.bmp')
dataFolder = "/home/tbeier/src/privatOpengm/experiments/datasets/bsd500/BSR/BSDS500/data/images/val/"
fFilter='.jpg'
batchMode=True
if hname =='tbeier-vaio':
data = vigra.readImage('/home/tbeier/Desktop/lena.jpg')
batchMode=False
ivigraph = IViGrahp()
ivigraph.win.show()
if batchMode :
ivigraph.setBatchInput(folder=dataFolder,fFilter=fFilter)
else :
ivigraph.setInput(dataIn=data)
fc=ivigraph.flowChart
viewerNodes=ivigraph.viewerNodes
# custom connections
fNode = fc.createNode('NewBlender', pos=(0, 0))
fc.connectTerminals(fc['dataIn'], fNode['dataIn'])
fc.connectTerminals(fc['dataIn'], viewerNodes[0]['data'])
#fc.connectTerminals(v1Node['view'], fNode['view'])
fc.connectTerminals(fNode['dataOut'], viewerNodes[1]['data'])
fc.connectTerminals(fNode['dataOut'], fc['dataOut'])
QtGui.QApplication.instance().exec_()