Skip to main content
. 2023 Sep 7;23(18):7724. doi: 10.3390/s23187724
Algorithm 2: Functioning steps for the proposed interface.
1: Begin
2: Initializing the global variable: ‘M’, and ‘P’ represented model and path.
3: Function I():      // importing model weight .h5
4:    If P is not empty:
5:      M = Load(P)
6:      Display(“Model imported successfully!”)
7: Function P():      // processing the image and generating the mask
8:    If M is null:

9:      Display(“Please import a model first!”)
10:    Return
11:    I = Dialog(“Select Image File”)
12:    If I is not empty:
13:      Img = Load(I)
14:      start_time()
15:      ImgArr = Preprocess(Img) // performing image resizing to 256 × 256
16:    PMask = Postprocess(Mask)  // post-processed mask
17:      end_time()
18:    GTMask = Load(GT)
19:    processing_time = end_time–start_time
20:    frame_rate = 1.0/processing_time
21:   ClearWindow()
22: Main():
23:   Create GUI window
24:   Add “Import Model” with I() as the callback
25:   Add “Process Image” with P() as the callback
26:   Start GUI event loop
27: Exit