Update demo.py
merge 'master' into develop
return val added
region based segmentation added
threshold based segmentation added
demo updated