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.

@LogWell found a solution how to prepare DATASETS. You can use following files structure:

See original GitHub issue

@LogWell found a solution how to prepare DATASETS. You can use following files structure:

datasets/CIHP/images/0002190.png
datasets/CIHP/list/img_list.txt
datasets/CIHP/images/tool/logwell_script.m
datasets/CIHP/images/edges
datasets/CIHP/images/labels

where datasets/CIHP/images/0002190.png - it’s a source image

datasets/CIHP/list/img_list.txt contain following data: 0002190.png

and datasets/CIHP/images/tool/logwell_script.m - it’s a MATLAB script for prepare edges and labels:

clear;
close all;
fclose all;
%%
imglist = '../list/img_list.txt';  % 00000.png
list = textread(imglist, '%s');

for i = 1:length(list);
    imname = list{i};
    instance_map = imread(fullfile('../images', imname));
    instance_contour = uint8(imgradient(rgb2gray(instance_map)) > 0);
    imwrite(instance_contour, fullfile('../edges', imname));
    imwrite(instance_contour, fullfile('../labels', imname));
    
end

Just run this script using command like: /opt/MATLAB/R2018b/bin/matlab -nodisplay -nojvm -nosplash -nodesktop -r "try, run('tool/logwell_script.m'), catch, exit(1), end, exit(0);"

and after that you can run python test_pgn.py for get segmented images.

_Originally posted by @rcrvano in https://github.com/Engineering-Course/CIHP_PGN/issues/26#issuecomment-496198813_

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:21

github_iconTop GitHub Comments

8reactions
qzanecommented, Oct 24, 2019

I write a python script to prepare the data, maybe you want to try it https://gist.github.com/qzane/4d07b7551914f97f2bf8b9c79138ab14

2reactions
mdrews93commented, Jun 14, 2021

I write a python script to prepare the data, maybe you want to try it https://gist.github.com/qzane/4d07b7551914f97f2bf8b9c79138ab14

@qzane Thank you for your python script. But this only generates the edges file and the respective blank(black) images. Do you have a python script to generate labels as well?

@gayalkuruppu I don’t think you need labels to get the correct output. I created a folder with custom images, ran the python script that was linked to in a previous comment (https://gist.github.com/qzane/4d07b7551914f97f2bf8b9c79138ab14 and I saved it as prepare_dataset.py) with

python prepare_dataset.py custom_dataset/CIHP/images CIHP

and it created a new folder within datasets/ called CIHP (it’ll be named whatever you use as the last argument in the previous python command).

The new folder has the structure

CIHP_PGN/
├─ datasets/
│  ├─ CIHP/
│  │  ├─ edges/
│  │  │  ├─ image0.png
│  │  │  ├─ image1.png
│  │  ├─ images/
│  │  │  ├─ image0.png
│  │  │  ├─ image1.jpg
│  │  ├─ list/
│  │  │  ├─ val_id.txt
│  │  │  ├─ val.txt

and then I was able to run python test_pgn.py and see the results in CIHP_PGN/output/cihp_parsing_maps/

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I read data into R? | SAMHDA
Whether the data was prepared using Excel (in CSV, XLSX, or TXT format), SAS, Stata, SPSS, or others, R can read and load...
Read more >
Preparing a dataset based on file data - Amazon QuickSight
Open a text file dataset for preparation by choosing one of the following options: Create a new Microsoft Excel dataset, and then choose...
Read more >
Three Ways of Storing and Accessing Lots of Images in Python
In this tutorial, you'll cover three ways of storing and accessing lots of images in Python. You'll also see experimental evidence for the...
Read more >
Get started with big data file shares—Documentation | ArcGIS ...
When using a big data file share for the input to a ArcGIS GeoAnalytics Server tool, you can browse for the item to...
Read more >
Load a dataset - Hugging Face
Begin by creating a dataset repository and upload your data files. Now you can use the load_dataset() function to load the dataset. 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