Skip to content
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

Convert data set to CSV with custom resize #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

umarkhan29
Copy link

This code creates a CSV format of data set with resized images of your defined size (Height, Width)
We got labels for every image from metadata and in new created dataset, first attribute defines the label
label == 1 defines COVID-19 and Label == 0 defines all others
Since Excel contains XFD as last column and XFD equals 16384. Thus we have to look for the resized height and width
In this example we took 40 x 40 with 3 channels making total row size (40x40x3)+1 +1 is added because label is stored as first attribute of image

This code creates a CSV format of data set with resized images of your defined size (Height, Width)
We got labels for every image from metadata and in new created dataset, first attribute defines the label
label == 1 defines COVID-19 and Label == 0 defines all others
Since Excel contains XFD as last column and XFD equals 16384. Thus we have to look for the resized height and width
In this example we took 40 x 40 with 3 channels making total row size (40x40x3)+1 +1 is added because label is stored as first attribute of image
# Plot the first image from the input dataset to be sure that data is correctly transformed
#============================================================
# Take a single image, and remove the color dimension by reshaping
imgSize = Height*Width*3 + 1 #We used first element as label

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All your code is perfectly clean and this small line is making noise to it.

img_size = Height*Width*3 + 1 #We used first element as label

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants