question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to prepare datasets/CIHP/labels and datasets/CIHP/edges

See original GitHub issue

Hello!

Can you explain please how to prepare files, which should be located in this directories: datasets/CIHP/labels and datasets/CIHP/edges

I’ve prepared the image file datasets/CIHP/images/image.jpg,

file datasets/CIHP/list/val_id.txt with content:

image

and file datasets/CIHP/list/val.txt with content:

images/image.jpg /labels/image.png

But I don’t understand how I can generate datasets/CIHP/labels/image.png and datasets/CIHP/edges/image.png ?

Because I need them for test_pgn.py. You answered here that in this dir can be placed any png image. But if I just convert image.jpg to image.png and put converted file into labels and edges dir the execution of the test_pgn.py failed with error

InvalidArgumentError (see above for traceback): assertion failed: [`labels` out of bound] [Condition x < y did not hold element-wise:] [x (mean_iou/confusion_matrix/control_dependency:0) = ] [255 255 255...] [y (mean_iou/ToInt64_1:0) = ] [20]

Please explain how to prepare image files for starting the segmentation process? Because your README.md file doesn’t explain how to do it. Just “Prepare the images and store in $HOME/datasets”. But what steps need to be done to prepare images in datasets dir?

Inference

  • Download the pre-trained model and store in $HOME/checkpoint.
  • Prepare the images and store in $HOME/datasets.
  • Run test_pgn.py.
  • The results are saved in $HOME/output
  • Evaluation scripts are in $HOME/evaluation. Copy the groundtruth files (in Instance_ids folder) - into $HOME/evaluation/Instance_part_val before you run the script.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

24reactions
neonb88commented, Jan 26, 2020

I think a lot of people got confused about this. I was confused too, initially.

You don’t actually have to install MATLAB or Octave, create good edges and labels. That won’t make the result better. The only reason it takes in edges and labels at all is to measure accuracy and precision.

I just wrote a method that doesn’t require MATLAB or Octave, only the python modules PGN already requires:

import numpy as np
import imageio as ii
from PIL import Image
nxb_img   = Image.open('datasets/CIHP/images/front.jpg')      # This is your image.
 
# Reshape their label image to our size 
label_img = Image.open('datasets/CIHP/labels/0005008.png')  # This is the label image from CIHP.
nxb_label_img = label_img.resize(nxb_img.size, Image.NEAREST)
nxb_label_img.save('datasets/CIHP/labels/front.png')

# Reshape their edge image to our size 
edge_img  = Image.open('/home/nathanbendich/CIHP_PGN/datasets/CIHP/edges/0005008.png')
nxb_edge_img  = edge_img.resize(nxb_img.size, Image.NEAREST)
nxb_edge_img.save('datasets/CIHP/edges/front.png')

You can use Logwell’s MATLAB code, but it won’t improve performance.

19reactions
LogWellcommented, May 11, 2019

感觉作者的回复有些敷衍, 希望作者能把README写得更清楚点~

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sonoma County Indian Health Project (SCIHP)
We are a Sonoma County Indian healthcare facility that serves the needs and traditional values of our American Indian Community.
Read more >
Health Information Management
A healthcare system to serve the needs and traditional values of our American Indian Community.
Read more >
Patient Services - Sonoma County Indian Health Project
This process informs management on causes of patient dissatisfaction and to provide them with opportunity to address these causes. We welcome individual ...
Read more >
SCIHP Announcements - Sonoma County Indian Health Project
Find information about Sonoma County Indian Health Project (SCIHP) announcements and events as well as links to our calendar.
Read more >
Medical Services - Sonoma County Indian Health Project
If you would like to be seen by a provider, but are unable to make a ... A SCIHP provider is available for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found