Search code examples
pythonpython-2.7google-colaboratory

How to download folders from Google Colaboratory


I know it's possible to download files from Google Colaboratory. At the moment I do this via files.download(). But is it possible to download a created directory in Colab?

I know how to code the unique ID and I will search for creating the masks. But in fact I have to download the directory directory_name with the same structure shown at the end (this saves time for me instead of running the code for it in Colab every time again after reconnecting to the VM).

So the question is: Is there any function to download the whole directory as a folder instead of downloading every image / mask for its own?

I want to make such a directory:

directory_name

... id_1

........ images

............... one image with id_1

........ masks

............... all the masks for the images (different ids)


Solution

  • Download the folder directly from the files tab that you can find on an arrow on top left of the screen https://colab.research.google.com/notebooks/io.ipynb