ESA-PhiLab / iris

Semi-automatic tool for manual segmentation of multi-spectral and geo-spatial imagery.
GNU General Public License v3.0
123 stars 39 forks source link

Image is not displayed correctly in browser #56

Closed ario101 closed 3 months ago

ario101 commented 3 months ago

I've been trying to write the config for my data. Here it is:

{
  "name": "Project_test6",
  "port": 5000,
  "images": {
      "path": "tif_iris/img{id}.tif",
      "shape": [256, 256],
      "thumbnails": false,  
      "metadata": false
  },
  "segmentation": {
      "path": "masks/{id}.png",
      "mask_encoding": "rgb",
      "mask_area": [0, 0, 256, 256],
      "score": "f1",
      "unverified_threshold": 1,
      "test_images": null
  },
  "classes": [
    {
      "name": "Class 1",
      "description": "Desc1",
      "colour": [255, 255, 255,0],
      "user_colour": [0, 255, 255, 70]
    },
    {
      "name": "Class 2",
      "description": "Desc2",
      "colour": [255, 150, 0, 70]
    }
  ],
  "views": {
      "RGB": {
          "description": "Normal RGB image.",
          "type": "image",
          "data": ["1", "2", "3"],
          "vmax": 10000,
          "vmin": 0
      },
      "Bing": {
          "description": "Aerial Imagery",
          "type": "bingmap"
      }     
  },
  "view_groups": {
      "default": ["RGB"]
  }
}

The image is not displayed correctly - it's either all-white in the views or all-black (in the latter case there's no error in the console):

1

What was done to try to resolve the issue:

None of the above resolved the issue.

Furthemore, when I press the button to go to the next image the app returns internal server error.

ario101 commented 3 months ago

Looks like I made it work. Here's the new config:

{
  "name": "Project_test7",
  "port": 5000,
  "images": {
      "path": "test_tif2/img{id}.TIF",
      "shape": [256, 256],
      "thumbnails": false,  
      "metadata": false
  },
  "segmentation": {
      "path": "masks/{id}.tif",
      "mask_encoding": "rgb",
      "mask_area": [0, 0, 256, 256],
      "score": "f1",
      "unverified_threshold": 1,
      "test_images": null
  },
  "classes": [
    {
      "name": "Class 1",
      "description": "Desc1",
      "colour": [255, 255, 255,0],
      "user_colour": [0, 255, 255, 70]
    },
    {
      "name": "Class 2",
      "description": "Desc2",
      "colour": [255, 0, 0, 255]
    }
  ],
  "views": {
      "RGB": {
          "description": "RGB",
          "type": "image",
          "data": ["$B1", "$B2", "$B3"],
          "clip": 1
      } 
  },
  "view_groups": {
      "default": ["RGB"]
  }
}

I'm assuming the issue was in how the bands were indexed in data. I thinks one important thing to consider when debugging the config is to create a new project (change the name in to a new one every time the change is made). Running this new config with old project resulted in Internal Server Error when changing the image.