Comments (5)
You need to use ImageClassificationData.from_filepaths()
, and then supply the filenames and labels as lists. The image paths will need to be extracted from the csv, something like:
# load in csv
df = pd.read_csv("train.csv")
# extract ids
ids = list(df["StudyInstanceUID"])
# get filenames by appending .jpg to id
filenames = [f"{id}.jpg" for id in ids]
# from https://www.kaggle.com/heyytanay/torch-trainer-augmentations-nfnets
# get labels for each id
labels = [label = df[df['StudyInstanceUID'] == id].values.tolist()[0][1:-1] for id in ids]
# hypothetically you could do this, if it wasn't multilabel, see note below
data = ImageClassificationData.from_filepaths(train_filepaths=filenames, train_labels=labels, ...)
NOTE: looking at the Kaggle competition this data appears to be multi-label, which the ImageClassificationData does not support (yet?)
from lightning-flash.
Looks like we need to update the docs on how to pass in train_labels (need to provide an array of labels, not a filepath)
from lightning-flash.
In the code it makes it seem as if you can pass a file. Will also claimed that he had this working is it possible something changed?
See line 304
https://github.com/PyTorchLightning/lightning-flash/blob/master/flash/vision/classification/data.py
from lightning-flash.
Yes that's something missing from the prediction interface a way to see the labels and a way to get the prediction class distribution. @williamFalcon
from lightning-flash.
https://github.com/PyTorchLightning/lightning-flash/blob/master/flash/data/data_utils.py#L6
from lightning-flash.
Related Issues (20)
- Instance Segmentation Example Broken HOT 3
- Issue with `ImageClassificationData.from_dataset` HOT 1
- Remove or replace the active learning loop example
- `SemanticSegmentationData` - zero-size array to reduction operation maximum which has no identity HOT 1
- Support for files stored on Google drives.
- Support generation kwargs within Seq2SeqTasks
- Error when importing flash.video in v0.8.1 HOT 2
- `ObjectDetectionData.from_coco`: `transform_kwargs` and `image_size error` HOT 2
- Getting error while using backbones and head code HOT 1
- Object detection example broken HOT 6
- `ObjectDetectionData.from_images` raise an error
- ImportError: cannot import name 'Labels' from 'flash.core.classification' HOT 1
- ModuleNotFoundError with lightning-flash[image] and ImageEmbedder HOT 8
- apply_func has been moved, need to update import HOT 5
- Protobuf requirements too strict HOT 5
- `ImageClassificationDataFrameInput` object has no attribute `target_formatter` HOT 1
- Flash Trainer not working - No module named 'pytorch_lightning.utilities.apply_func' HOT 1
- `download_data` from `flash.core.data.utils` connects to the internet before checking if a file exists HOT 1
- No module named 'pytorch_lightning.utilities.apply_func' HOT 4
- SemanticSegmentation has no available heads or backbones in FlashRegistry
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 lightning-flash.