# Google Codelab

> > cv2.imshow() is disabled in colab. Instead use
> >
> > from google.colab.patches import cv2\_imshow

## Write a program in Colab

Login your Google Account in Chrome.

Click below or [https://colab.research.google.com/notebooks](https://colab.research.google.com/notebooks/intro.ipynb#recent=true)

{% embed url="<https://colab.research.google.com/notebooks/>" %}

Start a New Note.

## Loading image file in CoLab

Read the following for detailed information: [Load images by Google Colab](https://colab.research.google.com/github/tensorflow/docs/blob/master/site/en/tutorials/load_data/images.ipynb)

### Method 1: [How to import an image from local drive](https://medium.com/@rk.sarthak01/how-to-import-files-images-in-google-colab-from-your-local-system-46a801b1e568)

```python
# Upload image file from local drive
from google.colab import files
uploaded=files.upload()
```

![](https://3883264845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MR8tEAjhiC8uN1kHR2J%2Fuploads%2Fgit-blob-06c46526aaaf25c5a94cfcdb8bb1c50e44adcf63%2Fimage%20\(244\).png?alt=media)

check the image file

```python
import cv2
from google.colab.patches import cv2_imshow  
import matplotlib.pyplot as plt
import matplotlib.image as mpimg

imgfName='cat2.jpg'

# Method 1: Open Image  with cv2
img=cv2.imread(imgfName)
cv2_imshow(img)

# Method 2: Open Image  with matplotlib
img=mpimg.imread(imgfName)
plt.imshow(img)
```

### Method 2: How to upload an image from local drive

![](https://3883264845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MR8tEAjhiC8uN1kHR2J%2Fuploads%2Fgit-blob-55803f92175d54adfc3ad0b68796261062832e89%2Fimage%20\(240\).png?alt=media)

## Loading dataset in CoLab


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ykkim.gitbook.io/dlip/installation-guide/ide/colab.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
