Comments (4)
It shouldn't matter which format you use as long as you correctly replace the part of the code which is loading the images. We chose that format simply because it was the fastest to load when we tested it on our cluster.
from breast_cancer_classifier.
Hi @aisosalo, I'm not 100% sure I understand your issue. The purpose of use-hdf5 is to read inputs that are in hdf5 format. We have not currently provided any hdf5 format sample inputs with the repository. It sounds like the functionality you're looking for is writing hdf5 formats instead? Let me know if I'm mischaracterizing your issue.
from breast_cancer_classifier.
Thank you for your answer, it resolved my issue. I clearly misunderstood the purpose of the use-hdf5
parameter.
My purpose was to make a script to ease monitoring the heatmap generation using PyCharm:
"""
Method adapted from breast_cancer_classifier function `run_producer` by
Nan Wu, Jason Phang, Jungkyu Park, Yiqiu Shen, Zhe Huang, Masha Zorin,
Stanisław Jastrzębski, Thibault Févry, Joe Katsnelson, Eric Kim, Stacey Wolfson, Ujas Parikh,
Sushma Gaddam, Leng Leng Young Lin, Kara Ho, Joshua D. Weinstein, Beatriu Reig, Yiming Gao,
Hildegard Toth, Kristine Pysarenko, Alana Lewin, Jiyon Lee, Krystal Airola, Eralda Mema,
Stephanie Chung, Esther Hwang, Naziya Samreen, S. Gene Kim, Laura Heacock, Linda Moy,
Kyunghyun Cho, and Krzysztof J. Geras , which is licensed under a GNU Affero General Public License v3.0.
See: https://github.com/nyukat/breast_cancer_classifier/blob/master/LICENSE
"""
import sys
import os
import random
import argparse
from src.heatmaps.run_producer import produce_heatmaps
from src.heatmaps.run_producer import load_model
print(sys.version, sys.platform, sys.executable)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Generate heatmaps')
parser.add_argument('--exam-list-path', default='sample_output/exam_list.pkl')
parser.add_argument('--image-path', default='sample_output/cropped_images')
parser.add_argument('--output-heatmap-path', default='sample_output/heatmaps')
parser.add_argument('--model-path', default='models/sample_patch_model.p')
parser.add_argument('--batch-size', default=100, type=int)
parser.add_argument('--use-hdf5', choices=[False, True], default=False)
parser.add_argument('--device-type', choices=['gpu', 'cpu'], default='gpu')
parser.add_argument('--gpu-number', type=int, default=0)
parser.add_argument('--seed', default=0, type=int)
args = parser.parse_args()
# Set the seed
random.seed(args.seed)
params = dict(
device_type=args.device_type,
gpu_number=args.gpu_number,
patch_size=256,
stride_fixed=70,
more_patches=5,
minibatch_size=args.batch_size,
seed=args.seed,
initial_parameters=args.model_path,
input_channels=3,
number_of_classes=4,
data_file=args.exam_list_path,
original_image_path=args.image_path,
save_heatmap_path=[os.path.join(args.output_heatmap_path, 'heatmap_malignant'),
os.path.join(args.output_heatmap_path, 'heatmap_benign')],
heatmap_type=[0, 1],
use_hdf5=args.use_hdf5 # when using hdf5 format sample inputs
)
# Get model
model, device = load_model(params)
# Generate heatmaps in the chosen format
produce_heatmaps(model, device, params)
from breast_cancer_classifier.
What might be the possible benefits of using hdf5
format mammogram images as an input to the network? Is it something to consider when fine-tuning the pre-trained models for a different dataset?
from breast_cancer_classifier.
Related Issues (20)
- Training procedure? HOT 3
- Tensorflow Error: Default MaxPoolingOp only supports NHWC on device type CPU HOT 3
- Converting .hdf5 heatmap file to PNG. HOT 1
- Question on when to use models in practical settings HOT 1
- Official request of the dataset HOT 1
- Resize transform for images during training HOT 1
- Preprocessing HOT 1
- helper function HOT 1
- some images doesn't work in crop_single_mammogram.py HOT 5
- Dataset HOT 1
- Outputs predictions HOT 1
- Data HOT 1
- Permission to release my PyTorch implementation for the training procedure and the dataset implementation HOT 3
- ImageNet weights HOT 1
- Weights Resnet 22 HOT 2
- question about model HOT 3
- How to create a new exam list ? HOT 3
- How do we manipulate the tensors with required_grad=True? HOT 2
- What loss we should use to train the SplitBreastModel ? HOT 1
- code HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from breast_cancer_classifier.