1
00:00:00,320 --> 00:00:07,240
this might look like a GPU smell like a

2
00:00:03,600 --> 00:00:10,480
GPU stick in a PCI Express 16x slot like

3
00:00:07,240 --> 00:00:12,679
a GPU and even talk like a GPU look at

4
00:00:10,480 --> 00:00:18,400
me I'm a little GPU but I assure you its intended purpose is very different and

5
00:00:15,280 --> 00:00:22,359
to some potentially terrifying it's

6
00:00:18,400 --> 00:00:26,920
dubbed the ASUS iot AI accelerator PCIe

7
00:00:22,359 --> 00:00:28,920
card or crl dg16 new- P3 DF for short

8
00:00:26,920 --> 00:00:33,240
and it's designed for artificial intelligence comput ation

9
00:00:39,960 --> 00:00:44,840
ooh historically we've mostly shied away

10
00:00:42,960 --> 00:00:49,879
from covering AI stuff and there's a couple of good reasons for it one is

11
00:00:47,760 --> 00:00:55,440
we're not AI or machine learning developers so finding practical use

12
00:00:53,000 --> 00:01:01,640
cases that we are able to set up and demo for you guys can be a little tricky

13
00:00:58,199 --> 00:01:04,439
and second a lot of those use cases are

14
00:01:01,640 --> 00:01:09,640
extremely technical behind the scenes kinds of things at least for now so

15
00:01:07,119 --> 00:01:15,119
Hardware like this isn't too applicable to end users like me and you that is

16
00:01:12,200 --> 00:01:18,920
until today while doing research for and testing the home automation setup at my

17
00:01:17,200 --> 00:01:22,240
new house get subscribed by the way you don't want to miss any future content

18
00:01:20,520 --> 00:01:26,360
around revamping that place we stumbled into a bit of a roadblock regarding

19
00:01:24,119 --> 00:01:30,119
presence detection or the ability for the systems in the house to be aware of

20
00:01:28,280 --> 00:01:34,360
whether or not anyone is actually home presence detection provides us with a

21
00:01:32,000 --> 00:01:38,520
number of benefits for example we can turn off lights and set the HVAC to be

22
00:01:36,840 --> 00:01:42,759
more energy efficient when there's nobody at home and this is relatively

23
00:01:41,000 --> 00:01:48,360
simple to implement on a whole house level but therein lies the challenge we

24
00:01:45,960 --> 00:01:52,119
put a lot of effort into making my house a lot more granularly controllable

25
00:01:50,520 --> 00:01:56,640
practically every room has its own independent HVAC and lighting which is

26
00:01:54,439 --> 00:02:00,640
awesome for personal preferences like the kids might want their rooms cooler

27
00:01:58,680 --> 00:02:05,479
than my wife and I do for example or vice versa but it can also be used to

28
00:02:03,039 --> 00:02:09,640
improve efficiency and save cost if no one's in the giant wreck room downstairs

29
00:02:08,039 --> 00:02:14,760
what's the point of heating and cooling it I mean surely that can't be that hard

30
00:02:11,680 --> 00:02:16,920
to automate well as we found out it can

31
00:02:14,760 --> 00:02:20,959
be really freaking hard one idea we had was to install Bluetooth low energy

32
00:02:18,640 --> 00:02:24,120
beacons in every room and read people's presence through their phones the only

33
00:02:22,720 --> 00:02:28,239
problem with that is that people have this tendency when they're at home to

34
00:02:26,280 --> 00:02:32,319
put their phone on a charger and oh I don't know walk around their house so

35
00:02:30,280 --> 00:02:37,239
that won't work another idea was to use motion sensors but those kind of crap

36
00:02:35,640 --> 00:02:41,560
the bed as soon as you decide to take a nap on the couch and then you wake up in

37
00:02:39,480 --> 00:02:47,760
a sauna of a room in the summer which sounds like a pretty bad time to me so

38
00:02:44,720 --> 00:02:50,280
this is where our AI card comes into

39
00:02:47,760 --> 00:02:54,440
play this is an ASUS designed product but all of the important AI bits are

40
00:02:52,640 --> 00:02:58,000
actually made by Google of all people under the brand Coral we've got both of

41
00:02:56,720 --> 00:03:03,640
them linked down in the description below let's take this thing apart this

42
00:02:59,879 --> 00:03:05,799
specific card has 16 onboard Edge tpus

43
00:03:03,640 --> 00:03:10,560
as Google calls them and the TPU stands for tensor Processing Unit in the most

44
00:03:08,360 --> 00:03:14,720
simple terms these tpus are Hardware processors that are physically designed

45
00:03:12,599 --> 00:03:18,200
and optimized to run a specific application you may have heard of

46
00:03:16,120 --> 00:03:22,519
something called an Asic as something that's really good at mining as specific

47
00:03:20,200 --> 00:03:26,200
cryptocurrency well these are the same idea except that in instead of mining

48
00:03:24,560 --> 00:03:31,680
Bitcoin they're for running machine learning inference calculations so what

49
00:03:28,879 --> 00:03:37,840
we're looking at here is essentially just a PCI Express 16x interface here

50
00:03:35,560 --> 00:03:43,560
going you can actually see the traces going right into this PCI Express switch

51
00:03:40,439 --> 00:03:45,879
which appears to be just splitting out

52
00:03:43,560 --> 00:03:52,920
these Lanes into an m.2 2x interface for each one of these

53
00:03:49,480 --> 00:03:56,040
little dual tpus here huh I I was

54
00:03:52,920 --> 00:03:58,720
expecting something less kind of modular

55
00:03:56,040 --> 00:04:04,599
and science fair projecty now each of the EDG tpus of which there are two on

56
00:04:01,480 --> 00:04:06,640
these m.2 cards can do around 4 trillion

57
00:04:04,599 --> 00:04:12,959
operations per second with a power draw of only two Watts so 2 Watts * 16 tpus

58
00:04:10,720 --> 00:04:18,239
brings us to 32 watts for the card you add in your PCIe switch and fans and

59
00:04:15,200 --> 00:04:21,120
that brings you to 52 Watts which is

60
00:04:18,239 --> 00:04:25,639
well within the 75 Watts that this PCI Express slot could power but for some

61
00:04:23,320 --> 00:04:30,880
reason it still requires a six pin power connector and it's got this gigantic

62
00:04:28,720 --> 00:04:36,320
copper fin cooler on it now you're probably thinking wow that's really cool

63
00:04:33,759 --> 00:04:39,440
Linus but most of this sounds like the boring technical stuff that you were

64
00:04:37,720 --> 00:04:42,720
talking about earlier but if you were following closely while we were

65
00:04:41,199 --> 00:04:47,919
researching better ways to detect presence in my new house we stumbled

66
00:04:44,800 --> 00:04:52,199
upon some software called frig that uses

67
00:04:47,919 --> 00:04:54,759
cameras plus this Hardware to really

68
00:04:52,199 --> 00:04:59,280
efficiently detect presence it's really freaking cool let's take it for a test

69
00:04:56,639 --> 00:05:02,400
drive I got to put this back together and we're up this test bench is running

70
00:05:00,960 --> 00:05:08,800
the latest version of UNR and it's going to stand in for my home NZ now you might

71
00:05:05,320 --> 00:05:11,360
notice there is also a GPU installed in

72
00:05:08,800 --> 00:05:16,360
it so we need that as a video output because this is a non Apu ryzen

73
00:05:14,000 --> 00:05:21,240
processor but it's also useful for offloading the camera video decode

74
00:05:18,560 --> 00:05:25,680
process from the CPU now in my home deployment I'll probably just use the

75
00:05:23,280 --> 00:05:29,319
CPU because I'm going to have 24 epic cores that are otherwise going to go

76
00:05:27,039 --> 00:05:31,840
unused but for now this is the better solution

77
00:05:30,160 --> 00:05:35,960
now once un raid's booted up you can see that we have just a single array disc

78
00:05:34,319 --> 00:05:39,600
with no redundancy that's not what I'd recommend as a production deployment but

79
00:05:38,080 --> 00:05:43,800
it's good enough for this video now we just pop over to the community apps Tab

80
00:05:41,720 --> 00:05:48,440
and installed apps so we've got our Coral accelerator module drivers we

81
00:05:46,240 --> 00:05:52,680
don't need this if we're using a USB version of Google's AI processor we only

82
00:05:50,479 --> 00:05:56,919
need it for the PCI Express version and then we've also got our NVIDIA drivers

83
00:05:54,639 --> 00:06:03,280
which are for our GPU now it should be noted that you can use your CPU for frig

84
00:05:59,960 --> 00:06:05,680
but performance is not good next we

85
00:06:03,280 --> 00:06:09,639
install frig now we can't just launch it we've got to actually configure frig

86
00:06:07,680 --> 00:06:14,080
otherwise it's going to have no idea what devices it's supposed to be using

87
00:06:11,240 --> 00:06:19,479
so step one we're going to copy the GPU uu ID from our NVIDIA driver and paste

88
00:06:16,639 --> 00:06:27,479
that there then for our TPU mapping we've mapped it to our Apex or0 device

89
00:06:23,840 --> 00:06:29,280
and that is only one of the 16 tpus that

90
00:06:27,479 --> 00:06:32,840
are on that card because we're only going to have a couple of cameras we're

91
00:06:31,240 --> 00:06:38,199
not going to bother mapping all of them but we did map five of them so that that

92
00:06:36,560 --> 00:06:43,880
should be enough for our demo for now wow this is a great password Jake I like

93
00:06:39,880 --> 00:06:45,360
it I see I don't get overwhelmed most of

94
00:06:43,880 --> 00:06:49,280
this is included in the template but there are a couple things that we had to

95
00:06:46,880 --> 00:06:53,400
tweak so one is we had to set up our camera so you can see we've pulled our

96
00:06:50,919 --> 00:06:57,319
camera from The Writer's den and we've got our network path for it right here

97
00:06:55,520 --> 00:07:01,639
we're just using the one camera for now we actually didn't take all five of our

98
00:06:59,800 --> 00:07:05,080
npus we've just got four of them configured here again this is total

99
00:07:03,360 --> 00:07:09,759
overkill for what we're doing and then we've also got this right here so we are

100
00:07:07,319 --> 00:07:16,080
limiting our frames per second for the camera feed that we're using to 5 FPS

101
00:07:13,280 --> 00:07:20,280
that is all we're going to need in 99% of situations to have functional

102
00:07:17,520 --> 00:07:24,360
detection and adding more processing to this would serve no real purpose one

103
00:07:22,759 --> 00:07:28,360
other critical thing back up at the top here is that you can Plum this into an

104
00:07:25,879 --> 00:07:33,080
mqtt server which is basically its way of communicating back to your other home

105
00:07:30,360 --> 00:07:39,080
automation devices So This mqtt Server 10.2.0 71 is running on our office home

106
00:07:36,199 --> 00:07:42,520
assistant instance hey 5 FPS of green I can see why you said we didn't need more

107
00:07:40,479 --> 00:07:47,759
FPS there's not a whole lot of movement there it's peanut butter demo time

108
00:07:45,400 --> 00:07:51,800
peanut butter demo time peanut butter demo time where you at where you at so

109
00:07:50,520 --> 00:07:56,680
that one camera is set up we have another one too but let's just okay hi

110
00:07:54,240 --> 00:08:01,440
there oh wait hold on I screwed up oh all right do we not have the detection

111
00:07:58,560 --> 00:08:07,039
on uh we but I I didn't turn on like the the bounding boxes bounding boxes are

112
00:08:03,680 --> 00:08:08,960
just little boxes that show us what the

113
00:08:07,039 --> 00:08:12,879
software is detecting and the degree of certainty that it has for what that

114
00:08:10,800 --> 00:08:16,680
object is humans aren't the only thing that it can detect but they're kind of

115
00:08:14,800 --> 00:08:18,960
the only thing that we care about for home automation presence detection

116
00:08:18,159 --> 00:08:24,599
you're telling me we don't have to detect how many apples you have in your fruit bowl oh yeah oh yeah oh you were

117
00:08:23,240 --> 00:08:28,440
there buddy oh it's kind of detecting your feet does it know who I am that

118
00:08:26,720 --> 00:08:34,959
part we have not done yet what if it only sees like this of me yeah it still

119
00:08:31,919 --> 00:08:37,640
thinks you're there what if my legs show

120
00:08:34,959 --> 00:08:42,719
oh it lost you it lost me what about a hand oh yeah it sees you again no really

121
00:08:40,640 --> 00:08:47,959
okay what if it just saw an elbow oh yeah it's detecting you what really yeah

122
00:08:45,760 --> 00:08:51,640
okay can it can it see me it's confused right now it's a little confused what

123
00:08:49,760 --> 00:08:55,640
about if there's just like a casual like hand there it's kind of freaking out so

124
00:08:53,600 --> 00:08:59,120
sometimes it actually sees two people um when he's kind of obscured but that's

125
00:08:57,320 --> 00:09:04,320
totally fine oh like it thinks I might be like two people having a sex orgy

126
00:09:01,279 --> 00:09:05,560
behind the curtain uh yeah sure but it's

127
00:09:04,320 --> 00:09:11,399
fine because all we need to know is if there's anyone right right yeah and sex

128
00:09:09,600 --> 00:09:15,399
orgy aside you don't want the heat to cut out during your sex orgy every get

129
00:09:13,560 --> 00:09:20,120
cold man you can do so much cool stuff with this but wait there's more what if

130
00:09:18,360 --> 00:09:24,040
you have a common area like a kitchen or a recck room and you want to be able to

131
00:09:21,640 --> 00:09:27,200
apply personalized preferences when you're present like say have your

132
00:09:25,640 --> 00:09:31,320
Spotify music with your specific playlist play when you're in the room

133
00:09:29,120 --> 00:09:35,200
and not when ivonne's in the room right oh I never even thought of that you

134
00:09:32,959 --> 00:09:39,959
could walk around the house and have Spotify playing here oh I'm over here

135
00:09:37,760 --> 00:09:43,640
now and now there's my Spotify over here oh my God that would be so cool turns

136
00:09:42,160 --> 00:09:47,560
out someone had that exact thought and created Double Take which is a piece of

137
00:09:45,440 --> 00:09:53,800
software that allows you to determine the face this is more

138
00:09:49,600 --> 00:09:55,680
creepy yeah but it's all local I mean we

139
00:09:53,800 --> 00:10:01,560
could just configure this to not log any of this right yeah did a Linus appear oh

140
00:09:58,760 --> 00:10:05,680
wow yeah nice now Double Take isn't available on the unraid community app

141
00:10:03,040 --> 00:10:09,160
store at least not yet so we need to manually set up the docker container

142
00:10:07,079 --> 00:10:14,120
ourselves then once it's set up we need to configure it to listen to frig it

143
00:10:11,480 --> 00:10:18,360
over mqtt it should be noted that double take itself doesn't do facial

144
00:10:16,160 --> 00:10:22,959
recognition it's just an API and interface to make hooking into and

145
00:10:21,120 --> 00:10:27,480
training facial recognition software easier so the first thing we need to do

146
00:10:25,320 --> 00:10:31,040
is grab some pictures of me which are going to be training data for our power

147
00:10:29,560 --> 00:10:34,920
facial recognition so I guess I need to go over there right uh we could go over

148
00:10:33,399 --> 00:10:40,600
there or we can just upload some photos we already have Double T currently supports deep stack compre face and face

149
00:10:38,880 --> 00:10:43,800
box they're all machine learning based facial recognition models deep stack is

150
00:10:42,240 --> 00:10:46,920
on the community App Store so that's the easiest to set up but I tried it out and

151
00:10:45,480 --> 00:10:50,760
it wasn't really that great with the limited training data I had compri face

152
00:10:48,800 --> 00:10:55,160
on the other hand it requires Docker compos have to run in a VM but it's

153
00:10:52,760 --> 00:10:59,320
scary good I put a couple photos of lonus and secretly kind of had him walk

154
00:10:57,440 --> 00:11:03,560
by without telling him and it was like lus and then I walked by it was like

155
00:11:00,760 --> 00:11:07,920
Jake with like 10 photos of each of us all right let's try it why do you have

156
00:11:05,160 --> 00:11:14,200
so many pictures of me on your hard drive well you make my my drive hard why

157
00:11:11,560 --> 00:11:19,680
CPU when I can see you pe why talk to you when I can leave can I zoom how do I

158
00:11:17,040 --> 00:11:24,880
use a Mac do you know no these Stills are horrible it's scary good Lord to see

159
00:11:22,399 --> 00:11:32,680
you without a beard oh wow yeah yeah yeah oh my God 95

160
00:11:29,920 --> 00:11:37,720
5.8% how can it be that sure on unbearded Linus training there was only

161
00:11:35,279 --> 00:11:43,480
one that it is actually confident about I mean 94% seems pretty damn confident

162
00:11:41,000 --> 00:11:48,040
to me we can do is take all of these yeah and say train off of those data now

163
00:11:46,720 --> 00:11:52,399
you want to walk over there again yeah for sure okay that's plenty there's so

164
00:11:49,920 --> 00:11:55,160
many luses now Linus Linus Linus Linus there's a couple times it thinks it's

165
00:11:53,360 --> 00:11:58,760
James I think like once you trained a good model with compr face I'd probably

166
00:11:56,839 --> 00:12:02,000
say that like it would only accept it as as that person person unless the

167
00:11:59,839 --> 00:12:07,399
confidence was like 99% some of these other models Madison I also made with

168
00:12:05,360 --> 00:12:10,760
people's photos with them wearing a mask so it like literally has the eyes okay

169
00:12:09,279 --> 00:12:18,519
go back run over there all right I'm going I'm going I'm going see if it makes more mistakes I'm going to pull up

170
00:12:14,880 --> 00:12:21,519
a chair lonus style it's very confident

171
00:12:18,519 --> 00:12:23,399
about lonus now what who else would

172
00:12:21,519 --> 00:12:26,959
behave like this I don't I don't think that's what it's looking for but man so

173
00:12:25,040 --> 00:12:31,199
you could just kind of wander around your house for 10 minutes find any

174
00:12:29,199 --> 00:12:34,839
anything that's wrong boom train it part of it is also going to be specific

175
00:12:33,120 --> 00:12:37,839
cameras because you know each camera looks a little different one thing I

176
00:12:36,399 --> 00:12:42,800
asked Jake about and he said it doesn't have this functionality for now is can

177
00:12:39,959 --> 00:12:46,800
it morph over time and can it continue to self-train the thing with facial

178
00:12:44,639 --> 00:12:50,760
recognition is like the more data you feed it the more uncertain it becomes

179
00:12:49,279 --> 00:12:56,040
all of this leaves us with some questions do you even need this thing

180
00:12:53,920 --> 00:13:02,480
could a bog standard CPU do the same calculations the answer is yes it could

181
00:12:59,440 --> 00:13:04,240
but way slower to put it in perspective

182
00:13:02,480 --> 00:13:09,800
your average quad core CPU would probably only be able to handle a few

183
00:13:06,240 --> 00:13:13,000
frames per second on a quad core but

184
00:13:09,800 --> 00:13:15,320
because these Edge tpus are so optimized

185
00:13:13,000 --> 00:13:21,440
for running these specific calculations they are stupid fast at them a single

186
00:13:18,680 --> 00:13:27,560
Coral Edge TPU can handle around 100 frames per second of people detection in

187
00:13:23,959 --> 00:13:30,199
frig and we've got 16 of them so if my

188
00:13:27,560 --> 00:13:33,639
rough math is correct that that's around 1,600 frames per second we might

189
00:13:32,240 --> 00:13:38,800
actually be pushing that once we've got all the cameras in the new place we're only taking 5 FPS from each still it's a

190
00:13:36,720 --> 00:13:43,279
lot of cameras No No 5 FPS yeah five okay yeah man that's crazy so a single

191
00:13:41,240 --> 00:13:48,320
one of these tpus could probably handle 15 to 20 cameras at 5 FPS another

192
00:13:46,519 --> 00:13:53,120
question this raises is are we worried about the security implications

193
00:13:50,560 --> 00:13:59,720
fortunately since we have all of our own hardware and all of this is open source

194
00:13:56,320 --> 00:14:01,440
and locally hosted none the data goes

195
00:13:59,720 --> 00:14:06,519
outside of my house so I'm actually pretty happy with the level of security

196
00:14:03,360 --> 00:14:08,639
and safety as for being worried about AI

197
00:14:06,519 --> 00:14:14,240
taking over no one's asking that question it's in here anyway the answer

198
00:14:11,279 --> 00:14:19,440
is no leaving only one question then who's our sponsor freshbooks freshbooks

199
00:14:17,600 --> 00:14:23,199
is the simple accounting solution that is designed specifically with you in

200
00:14:21,240 --> 00:14:27,000
mind the small business owner it features built-in automation that allows

201
00:14:24,800 --> 00:14:30,680
you to spend less time tracking projects and more time growing your business so

202
00:14:28,800 --> 00:14:34,800
whether you're a trades person creative agency or a YouTuber you can choose the

203
00:14:33,440 --> 00:14:38,240
plan that's right for you with freshbooks they have an award-winning

204
00:14:36,440 --> 00:14:41,800
Toronto based support team who are always happy to help you if you need it

205
00:14:40,240 --> 00:14:45,800
and you don't have to take my word for it you can try fresh books for free for

206
00:14:43,720 --> 00:14:50,959
30 days today with no credit card required at freshbooks.com

207
00:14:48,399 --> 00:14:53,880
Linus if you enjoyed this video maybe go check out the video where we built the

208
00:14:52,360 --> 00:15:00,519
server that is going to be running all this stuff we're going to have to get a little bit creative with PCI Express

209
00:14:57,639 --> 00:15:04,240
expansion on it um but that's the machine that's going to somehow run this

210
00:15:01,959 --> 00:15:07,759
full height card yeah yeah so good luck everybody are we going to do an external

211
00:15:05,600 --> 00:15:10,560
PCI box we should totally do it yeah we should totally do it yeah that'll be a

212
00:15:08,800 --> 00:15:13,240
video get subscribed we can water cool it and everything
