Skip to content

Commit

Permalink
Added a json supporting
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkonrom committed Nov 30, 2017
1 parent f38a139 commit 7731a71
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
3 changes: 2 additions & 1 deletion boundaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

class BoundariesOperation(Operation):
@staticmethod
def execute(input_image, filter_number):
def execute(input_image, settings):
filter_number = settings[0]
grayscale = input_image.convert('L')
if filter_number == 1:
edges = roberts(grayscale)
Expand Down
1 change: 1 addition & 0 deletions mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def setupUi(self, MainWindow):
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap("python/C:/Users/jeavr/Desktop/unnamed.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
MainWindow.setWindowIcon(icon)
MainWindow.setStyleSheet("")
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
Expand Down
3 changes: 3 additions & 0 deletions mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
<iconset>
<normaloff>python/C:/Users/jeavr/Desktop/unnamed.png</normaloff>python/C:/Users/jeavr/Desktop/unnamed.png</iconset>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
Expand Down
20 changes: 20 additions & 0 deletions serialization.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import json


class Settings(object):
def __init__(self, boundaries_settings, segmentation_settings, saliency_settings, face_settngs):
self.boundaries_settings = boundaries_settings
self.segmentation_settings = segmentation_settings
self.saliency_settings = saliency_settings
self.face_settings = face_settngs


def serialize(settings):
filename = 'settings.json'
json.dump(settings, filename)


def deserialize():
filename = 'settings.json'
return json.load(filename)

0 comments on commit 7731a71

Please sign in to comment.