- [Instructor] Hi, my name is Haegen.
I'm a solutions architect and SageMaker Edge team.
In this video, I will show you how to configure
the SageMaker edge agent.
To capture data from edge device.
So you can retrain your existing models with spilled data
or build new models.
You can also use this data to conduct your own analysis,
such as model drift analysis.
The application on the edge device decides when to capture
and what data to capture.
It then sends a capture request to the edge agent.
For example,
you can decide to capture periodically,
let's say every hour or once a day on specific triggers,
like the confidence score of a prediction being repeatedly
low.
The capture request can include input output potentials.
I suppose, optional auxiliary data.
Data can be uploaded to the cloud or kept on a local disc.
The capture events are handled asynchronously.
The agent buffers capture requested memory.
You can configure how many requests should be buffered,
after how many requests the agents had handled the request,
and the time period after which request should be handled.
This example configuration you can see,
that the edge agent uses a local buffer
for up to 30 capture requests.
It will attempt to upload the captures data to S3
after 10 requests,
or 4,000 seconds. Whichever comes first.
We recommend to have the batch set to at most half the
buffer size.
You can use the data buffer and data push period to address
issues with devices that have less reliable and frequently
than a connection.
But you have to consider the amount of memory that the
buffer requires on your device.
The fact that the buffer is a non-persistent memory.
For devices that have very infrequent internet connections
or for testing,
the edge agent also supports capturing data to a
local disk on the edge device.
To do that,
you have to set the captured data destination as disk,
and not cloud.
And also specify a local file pass at
the edge agent rule used to capture data.
You can still have the device upload captures to the cloud
to enable this.
You set the periodic upload flag to two.
And sets the periodic upload period and seconds.
As in this example,
each capture consists of adjacent lines file that describes
the captured data.
And by default one file for each data element,
you can also include smaller data elements in the JSON
file by defining the basics different bed limit.
Any data element that is smaller than this limit,
will be based 64 encoded and uploaded as an inland element
in the JSON file.
Now let's have a look at how this fits into the machine
learning life with edge devices.
The initial model can be created in SageMaker.
That model then gets optimized
and packaged for deployment on a fleet of edge devices.
The model is running on a device,
the edge agent run them
that to capture data from those models
and send that data back into the cloud.
The uploaded data can be used to retrain the model
for better performance.
That updated model can then go through the same cycle again.
Now let's have a look,
what's a capture data looks like on our S3 package.
Navigated to the S3 console.
And the package that I store my captures in,
the fuller that I use as the edge inference outputs.
I have captures here for multiple fleets.
So let's go to the demo device fleet.
I want to look at the captures from my yolo-v3 model,
and they can see them they're organized by date.
So let's grab the most recent one.
There's two JSON found in here.
So there were two captures.
let's download the specific capture file.
So let's download the JSON file using the command line tool.
(intructor goes silent)
And let's have a look at the file.
Let's first reformat so we can make it easier to read.
We see that we have the auxiliary inputs,
auxiliary outputs,
device fleet inputs which is the input tensor.
So we can see that
we run a prediction on the 416 by 416 size image.
Then there's the output from the yolo-v3 model,
as well as some eventMetadata.
So we can see the device fleet that the device belongs to,
that the captures from,
the device ID.
Then, the inference for this capture,
the model name, as well as the model version,
let's have a look at the auxiliary data can see that there's
one element that's actually in base 64.
So let's decode that we can see it's adjacent strings.
So let's reformat that again so we can ease it,
make it easier to read.
So we have the prediction time in this, JSON,
the bounding boxes for all the predictions,
the confidence score and the label for all the predictions.
But we can also have a look at the actual image.
So in this specific case,
I'm saving the input image as well as the input images
as the bounding boxes as JPEG files.
So we can download those,
fairly quickly.
(computer keypad rattling)
jpg.
Let's also get the output,
(computer keypad rattling)
jpg
And now let's have a quick look at those two images.
(computer keypad rattling)
Here we go.
So we can see the input image that the prediction was ran
on.
And then the output, which is the same image,
just impounding boxes
and the predictions drawn on top of it.
This concludes the demo.
Here's some additional resources,
including a link to our documentation of supported platforms
and devices,
linked to the GitHub repository for the quick
device setup tool,
as well as links to notebooks and workshops that can help
you get started with SageMaker Edge.
Thank you.
And please have a look at our other demo videos as well.