-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Support for Loading CSV datasets #1050
Open
shenghann
wants to merge
22
commits into
openvinotoolkit:feature/add-csv-data
Choose a base branch
from
shenghann:feature/add_csv_dataset
base: feature/add-csv-data
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add Support for Loading CSV datasets #1050
shenghann
wants to merge
22
commits into
openvinotoolkit:feature/add-csv-data
from
shenghann:feature/add_csv_dataset
+495
−249
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
samet-akcay
requested changes
Apr 27, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for creating this PR. I've got few comments.
Co-authored-by: Samet Akcay <samet.akcay@intel.com>
Co-authored-by: Samet Akcay <samet.akcay@intel.com>
djdameln
requested changes
May 17, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is a nice feature to have. I have a few comments:
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
PR stemming from this discussion: #1042
In summary, to add csv file loading functionality to anomalib on top of loading from folders for custom datasets.
The CSV dataset format:
image_path
: Path to image file (to join with root fromconfig.dataset.root
)label
:normal
,abnormal
ornormal_test
split
: If split column not defined in CSV, generatetrain
andtest
splits the based on labels (same as how folder dataset handles this: normal samples = train, all abnormal and normal_test samples = test). Need to check thattrain
split should only havenormal
. if abnormal found drop and ignore.label_index
: function oflabel
where,normal
=0
andabnormal
=1
mask_path
csv_file
config key - path to csv fileCode changes:
CSVDataset
andCSV
DataModule_prepare_filemeta_from_csv
function inpath.py
using pandas to read CSV contents, ensure file required columns defined in csv file are correctly defined, have the correct extensions._setup
inmake_csv_dataset
data/utils/image.py
andlightning_inference.py
Also addresses #1072
Changes
Checklist