How can I train (manually labeled) x-ray image data using CNN (labeled data in .json format)?
7 次查看(过去 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
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);
采纳的回答
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Web Services 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!