How can I train (manually labeled) x-ray image data using CNN (labeled data in .json format)?

조회 수: 6 (최근 30일)
I have manually labeled some x-ray image data using dataturks.com I downloaded the file which contain the labeled information. But, the downloaded file is in .json format. Using these .json files, how can I train data in CNN? Can MATLAB understands .json file like .mat file?
  댓글 수: 2
Kevin Chng
Kevin Chng 2018년 9월 19일
편집: Kevin Chng 2018년 9월 19일
Do you mind to attach your jason file hereby?
or you may try code below on how to decode jason in MATLAB
fname = 'meta_Electronics.json';
fid = fopen(fname);
raw = fread(fid,inf);
str = char(raw');
fclose(fid);
val = jsondecode(str);
Fahad Parvez Mahdi
Fahad Parvez Mahdi 2018년 9월 27일
Thank you Kevin, but the code is not running. The following error is showing. Error using jsondecode JSON syntax error at line 2, column 1 (character 3689): extra text.
I have attached the json file with my question.

댓글을 달려면 로그인하십시오.

채택된 답변

Kevin Chng
Kevin Chng 2018년 10월 2일
Hi Fahad Parvez Mahdi,
Sorry for my late reply, It is because there are so many web link in your json file. Therefore, you have to decode them one by one.
Please refer to the code below, it will help you decode your json file. There are 50 web links.
fname = 'Dental X-Ray Image Dataset 1.json';
fid = fopen(fname);
raw = fread(fid,inf);
str = char(raw');
fclose(fid);
k = strfind(str,'con');
k=k-3
k(1:2:end)=k(1:2:end)+1
w=1;
for i=1:2:length(k)
val(w) = jsondecode(str(k(i):k(i+1)));
w=w+1;
end
if you have any inquiries, you are always welcome.
  댓글 수: 2
Fahad Parvez Mahdi
Fahad Parvez Mahdi 2018년 10월 2일
Hi Kevin,
Thank you very much for the code. I can now see the data stored inside the file. Still long way to go. I will knock back you if I need any further assistance from you. Take care.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Web Services에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by