Skip to content

Instantly share code, notes, and snippets.

@Zakaria-pro
Created June 13, 2020 13:57
Show Gist options
  • Save Zakaria-pro/61798d03c9aecd0dbfe8bbb2bfb51d80 to your computer and use it in GitHub Desktop.
Save Zakaria-pro/61798d03c9aecd0dbfe8bbb2bfb51d80 to your computer and use it in GitHub Desktop.
Data_understanding
#Put all the images into a list
listOfImageNames = []
for dirname, _, filenames in os.walk('/kaggle/input/insulation-joint-training-set-prorail/trainset_insulation_joint/images/'):
for filename in filenames:
#print(os.path.join(dirname, filename))
listOfImageNames.append(os.path.join(dirname, filename))
#define a function that display an image and it's label knowing the indice of this image
def display_image(indice):
print(df[df['label'].index==indice]) #print the label of the image
display(Image(filename=listOfImageNames[indice], width=700, height=700))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment