1
00:00:01,220 --> 00:00:08,270
In this section we will be using the drone camera and stream the contents to a Web camera to start off.

2
00:00:08,270 --> 00:00:13,340
We will need to set a server using the web framework to access the video.

3
00:00:13,550 --> 00:00:16,650
In this lesson we will be using flask.

4
00:00:16,700 --> 00:00:18,280
We need to install the package.

5
00:00:18,290 --> 00:00:25,430
But before that I want you to move the drone manager p p y file to a different directory.

6
00:00:25,430 --> 00:00:29,690
Right click on the P Y Tello folder and choose new.

7
00:00:29,780 --> 00:00:35,130
Then select directory let's name it to drone app and hit.

8
00:00:35,150 --> 00:00:41,940
OK now right click on the drone app folder to create a directory.

9
00:00:42,370 --> 00:00:45,030
Choose New and directory.

10
00:00:45,400 --> 00:00:48,870
Let's create all the directories that we will be needing.

11
00:00:49,060 --> 00:00:56,040
The first directory name will be controllers click on the drone app folder and you will see the new

12
00:00:56,040 --> 00:00:59,210
controllers directory that we created.

13
00:00:59,250 --> 00:01:03,790
Again we want to create a directory under drone apps.

14
00:01:03,810 --> 00:01:09,780
This time we will name the directory to models continue creating the directories.

15
00:01:09,810 --> 00:01:13,740
This time we set the directory name to templates.

16
00:01:13,740 --> 00:01:17,220
This is where we set the flask templates.

17
00:01:17,220 --> 00:01:25,400
We also want to use a static file so continue creating a new directory set the directory name to static

18
00:01:25,670 --> 00:01:26,620
and head okay.

19
00:01:27,870 --> 00:01:32,760
We just finished creating four new folders under the drone app directory.

20
00:01:32,760 --> 00:01:37,890
Controllers models static and templates.

21
00:01:37,920 --> 00:01:42,680
Now I want you to move the drone manager P Y file to the models directory.

22
00:01:43,140 --> 00:01:47,440
When you see this message click OK.

23
00:01:47,490 --> 00:01:49,750
Now the new path is the drone app.

24
00:01:49,890 --> 00:01:52,710
Models drone manager P Y.

25
00:01:53,250 --> 00:01:57,350
Once we move the python file we need to create the init file.

26
00:01:57,660 --> 00:02:02,490
Right click our models and choose new python file.

27
00:02:02,820 --> 00:02:06,340
Set the name of the file to double underscore in it.

28
00:02:06,390 --> 00:02:11,100
Double underscore and hate OK we can close this tab.

29
00:02:11,370 --> 00:02:20,620
We will set the main P Y to invoke commands by accessing the drone manager P Y the logging basic config

30
00:02:20,770 --> 00:02:28,110
was set to receive the logs for this file so we can cut this line and move it to the main P Y pastebin

31
00:02:28,200 --> 00:02:33,580
the line and let's not forget to import logging and sis.

32
00:02:33,940 --> 00:02:36,230
Let's go back to the drone manager.

33
00:02:36,520 --> 00:02:40,910
You can revise the script so it will fit the PEP 8 code style.

34
00:02:40,960 --> 00:02:44,140
Also you can delete import sis.

35
00:02:44,290 --> 00:02:46,580
Scroll down to the bottom the script.

36
00:02:46,600 --> 00:02:50,560
You can also delete all the test commands that we set.

37
00:02:50,560 --> 00:02:57,850
Now we've cleared this file so we can go back to the main copy why we won't set the main P Y to invoke

38
00:02:57,880 --> 00:03:01,740
other files yet before we go on.

39
00:03:01,760 --> 00:03:08,000
We need to install flask right click on the UI Tello and choose new.

40
00:03:08,360 --> 00:03:15,650
We need to create a requirement document on text so let's choose file on the top set the file name to

41
00:03:15,650 --> 00:03:19,660
requirements t x t and hit OK.

42
00:03:19,810 --> 00:03:24,970
I also explained about the different package version we will be installing when we installed the open

43
00:03:24,970 --> 00:03:25,510
CV.

44
00:03:26,790 --> 00:03:33,660
You may have a slight difference depending on the version in this course we will be using these packages

45
00:03:35,160 --> 00:03:38,710
open CV will be 4 point 0 point 0.

46
00:03:38,720 --> 00:03:48,430
Point 2 1 num be one point one six point two flask will be one point 0 point 2.

47
00:03:48,980 --> 00:03:52,660
So we set this in their requirement text.

48
00:03:52,700 --> 00:03:54,500
Next we go to the terminal.

49
00:03:54,530 --> 00:03:59,140
If you are using Anaconda you can directly install with Pip.

50
00:03:59,540 --> 00:04:08,120
If you installed the python binary you can set Pip 3 install hyphen R requirements t x t and run this

51
00:04:08,120 --> 00:04:13,650
code since my computer has all the packages installed.

52
00:04:13,800 --> 00:04:16,470
There were no installation that started.

53
00:04:16,470 --> 00:04:22,550
If you are missing any packages in your computer the installation process should have started.

54
00:04:22,620 --> 00:04:29,870
Once you finish installing the package type Pip 3 frees to check if the installation process was done.

55
00:04:31,220 --> 00:04:35,180
As you run this command a list of the packages will come up.

56
00:04:35,180 --> 00:04:38,670
Check to see if you have installed the proper package.

57
00:04:38,780 --> 00:04:44,270
You may see other packages installed also but be sure you have these three main packages.
