Downloads · 30 days
0
ummtushar/thoracic-disease-classifier
thoracic-disease-classifier is a image classification model from ummtushar. Use it when you need a label for an image. It is set up for PyTorch. The card lists the license as mit.
Here is a brief guide to run our repository: 1. Create a virtual environment 2. Run "pip install -r requirements.txt" in the terminal 3. Run the dc1\imagedataset.py file to download the data. 4. Run dc1\main\py to tra…
Downloads · 30 days
0
Access
Public
Updated Sep 7, 2024
Repo size
276 MB
Likes
0
Public
Click a slice to open those files.
.npy276 MB · 100%
From the Hugging Face model README
Here is a brief guide to run our repository:
dc1\image_dataset.py file to download the data.dc1\main\py to train and test the modelmain.py you can select the model by commenting the models you are not interested in and uncommenting the one you would like to use.
Exception: For the binary model you would need to comment the following:
train_dataset = ImageDataset(Path("data/X_train.npy"), Path("data/Y_train.npy")) & test_dataset = ImageDataset(Path("data/X_test.npy"), Path("data/Y_test.npy"))
and uncomment the loading of the binary dataset:
train_dataset = ImageDatasetBINARY(Path("data/X_train.npy"), Path("data/Y_train.npy")) & test_dataset = ImageDatasetBINARY(Path("data/X_test.npy"), Path("data/Y_test.npy"))This repository contains the template code for the TU/e course JBG040 Data Challenge 1. Please read this document carefully as it has been filled out with important information.
This repository contains the template code for the TU/e course JBG040 Data Challenge 1. Please read this document carefully as it has been filled out with important information.
The template code is structured into multiple files, based on their functionality.
There are five .py files in total, each containing a different part of the code.
Feel free to create new files to explore the data or experiment with other ideas.
To download the data: run the ImageDataset.py file. The script will create a directory /data/ and download the training and test data with corresponding labels to this directory.
To run the whole training/evaluation pipeline: run main.py. This script is prepared to do the followings:
Net.py file./artifacts/ subdirectory)/model_weights/ subdirectory so that you can reload them later.In your project, you are free to modify any parts of this code based on your needs.
Note that the Neural Network structure is defined in the Net.py file, so if you want to modify the network itself, you can do so in that script.
The loss functions and optimizers are all defined in main.py.
*For information on how to install PyCharm and link Github to your PyCharm, we refer to the additional resources page on Canvas.
We recommend to set up a virtual Python environment to install the package and its dependencies. To install the package, we recommend to execute pip install -r requirements.txt. in the command line. This will install it in editable mode, meaning there is no need to reinstall after making changes. If you are using PyCharm, it should offer you the option to create a virtual environment from the requirements file on startup. Note that also in this case, it will still be necessary to run the pip command described above.
After each sprint, you are expected to submit your code. This will not be done in Canvas, instead you will be creating a release of your current repository. A release is essentially a snapshot of your repository taken at a specific time. Your future modifications are not going to affect this release. Note that you are not allowed to update your old releases after the deadline. For more information on releases, see the GitHub releases page.
*After the first release, you should click Draft a new release instead of Create a new release
The template is created with support for full typehints. This enables the use of a powerful tool called mypy. Code with typehinting can be statically checked using this tool. It is recommended to use this tool as it can increase confidence in the correctness of the code before testing it. Note that usage of this tool and typehints in general is entirely up to the students and not enforced in any way. To execute the tool, simply run mypy .. For more information see https://mypy.readthedocs.io/en/latest/faq.html
Argparse functionality is included in the main.py file. This means the file can be run from the command line while passing arguments to the main function. Right now, there are arguments included for the number of epochs (nb_epochs), batch size (batch_size), and whether to create balanced batches (balanced_batches). You are free to add or remove arguments as you see fit.
To make use of this functionality, first open the command prompt and change to the directory containing the main.py file.
For example, if you're main file is in C:\Data-Challenge-1-template-main\dc1,
type cd C:\Data-Challenge-1-template-main\dc1\ into the command prompt and press enter.
Then, main.py can be run by, for example, typing python main.py --nb_epochs 10 --batch_size 25.
This would run the script with 10 epochs, a batch size of 25, and balanced batches, which is also the current default.
If you would want to run the script with 20 epochs, a batch size of 5, and batches that are not balanced,
you would type main.py --nb_epochs 20 --batch_size 5 --no-balanced_batches.