关键词 > Python代写

Introduction to Artificial Intelligence Homework 0 Spring 2022

发布时间:2022-02-23

Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Spring 2022

Introduction to Artificial Intelligence

Homework 0

Introduction

We suggest using the Python language to implement all programming assignments in this course. The purpose of this assignment is to help you get started with Python. Moreover, we will use the following exercises in subsequent homework.

 

Setting up your environment

If you don’t have Python installed on your machine, we recommendGoogle Colab. If you want to work on your own machine, we recommend installingAnaconda to manage your Python environments. Please install Python with version 3.8, which is the version TAs use to grade in this course.

 

Python tutorial

We suggest you follow this tutorial:https://cs231n.github.io/python-numpy-tutorial/

If you are familiar with Python, you can skip this part.

 

Exercise

Exercise 1: Draw bounding box on cars

●   The  text  file  (bounding_box.txt)  and  image  (image.png) can be found from the “data” folder on E3 HW0.

●   Read the text file. The text file contains the coordinates of the bounding box. The format is following by:

 

x1 y1 x2 y2

E.g.

 

 

●   Install any python packages which can read images (e.g., Pillow, OpenCV), and read their documentation to learn how to use functions.

●   Draw bounding boxes on the image. The coordinate (x1, y1)  is the bottom left corner of a bounding box. The coordinate (x2, y2) is the top right corner.

●   Save the image with bounding box as below:

 

 

Exercise 2: Extract the pixels of the objects that are moving in the video.

●   The video (video.mp4) can be found from the “data” folder on E3 HW0.

●   Modify sample code to achieve the purpose of removing the background in the video,

and take a screenshot of the final result like the image below. Note that you should

stack the pictures shown as follows (Hint 2).

 

●   Hint1 : Use OpenCV packages which can remove the background. (e.g., cv2.absdiff)

●   Hint2 : You can use numpy.hstack to show two frames at the same time.

 

Grading

In this homework, you will get 100 only ifyou finish all requested tasks and will not get any part score even ifyou finish part ofthe tasks.

 

Discussion

TAs had opened a channel  on Microsoft Teams of the course, you can ask questions about the homework in the channel. TAs will answer questions in the channel as soon as possible.


Discussion rules:

1.   Do not ask for the answer to the homework (probably no need to worry about this homework).

2.   Check if someone has asked the question you have before asking.

3.   We encourage you to answer other students’ questions, but again, do not give the answer to the homework. Reply to the messages to answer questions.

4.   Since we have this discussion channel, do not send emails to ask questions about the homework unless the questions are personal and you do not want to ask publicly.

 

Submission

1.   The deadline for this homework is 2/28 (Mon.) 23:55:00.

2.   Please submit one zip file that contains two Python code (i.e., .py) files and two screenshots ofthe final results ofthe two exercises.

3.   Submit   the   zip   file   with   the   filename   of  HW#number_StudentID.zip   (e.g., HW0_109123456.zip). Please refer to the File Organization  Section to name each submission file.

4.   Late  submission  leads  to  a  score  of (original score)*0.85days, for example, if you submit your homework right after the deadline, you will get (original score)*0.85 points.

5.   We only accept one zip file, wrong format or naming format cause -10 points to your score (after considering late submission penalty).

6.   Ifthere is anything you are not sure about submission, ask in the discussion forum.

 

File Organization

1.   The input file names should follow in this spec (blue bold words above) for TAs to test your results. The wrong format will cause -10 points as well. You don’t need to hand these input files in.

2.   Please follow the file hierarchy and the naming rules specified below.