Search for question
Question

Please try to use Google Colab to complete this lab. For specific steps, please follow the template file (lab1_student.ipynb). There are six steps in total, of which the code of the first two steps has been provided to you, you only need to follow the prompts to complete the next four steps. Four images (1.png, 2.png, 3.png, 4.png) will be used in this lab. You can download them from Canvas and upload them to Google Colab as shown below. Since this lab does not need to use GPU, so you can directly use the CPU mode. Lab 1_student.ipynb PRO File Edit View Insert Runtime Tools Help All changes saved X III E ELEC 4806/5806 Introduction to Deep Learning and PyTorch Lab 1 PyTorch basic practice o Files sample_data 1.png 2.png 3.png 4.png + Code + Text 1. import the required libraries [1] import cv2 import torch import glob import numpy as np Comment [2] img_list = [] # a list used to save all the images in the current directory for img in glob.glob("*.png"): image cv2.imread (img) img_list.append(image) RAM I Disk ↑ ↓ Sha 2. Read in the images (1.png, 2.png, 3.png, 4.png) in the current directory and save them to a list (so the length of this list is 4). ▾ Each element in this list is a numpy array (an image). All the images have the same shape (height, width, channel), which is (555, 695, 3) in this lab. Submission requirements (all team members need to submit): 1. Please submit the .ipynb file and make sure the TA or the instructor can easily run your code. If you use google colab, you can download the .ipynb file by clicking "File➜Download Download .ipynb". Please include the names of all team members in the file name. 2. Please submit a pdf version as well. You can use this website (https://htmtopdf.herokuapp.com/ipynbviewer/ ) to convert your .ipynb file to pdf. 3. Please record a video to demo your work. In the video, please explain your code line by line and all team members must participate in the recording. If the team members cooperate remotely, they can submit multiple videos.