Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adaptive learning #78

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

alpha-carinae29
Copy link
Contributor

add Adaptive Learning support for USB TPU.
for more information about Adaptive Learning visit here

README.md Outdated
@@ -182,6 +182,23 @@ docker build -f x86-openvino.Dockerfile -t "neuralet/smart-social-distancing:lat
docker run -it -p HOST_PORT:8000 -v "$PWD/data":/repo/data -v "$PWD/config-x86-openvino.ini":/repo/config-x86-openvino.ini -v "$PWD/certificates/processor":/repo/certs -e TZ=`./timezone.sh` neuralet/smart-social-distancing:latest-x86_64_openvino
```

##### Run on AMD node with a connected Coral USB Accelerator with Adaptive Learning Support
Currently Smart Social Distancing supports Adaptive Learning framework on X86 nodes with connected USB TPU. for more information about Adaptive Learning visit [this page](https://github.com/neuralet/neuralet/tree/master/applications/adaptive-learning)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Currently Smart Social Distancing supports Adaptive Learning framework on X86 nodes with connected USB TPU. for more information about Adaptive Learning visit [this page](https://github.com/neuralet/neuralet/tree/master/applications/adaptive-learning)
Currently Smart Social Distancing supports Adaptive Learning framework on X86 nodes with connected USB TPU. For more information about Adaptive Learning visit [this page](https://github.com/neuralet/neuralet/tree/master/applications/adaptive-learning)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

import threading


class ConfigEngine:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we reuse the ConfigEngine from libs/ConfigEngine.py here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, thanks for suggestion. Done.


bash /repo/sample_startup.bash $CONFIG &
bash /repo/update_model.bash $CONFIG &
#trap "echo exitting because the model name is not compatible with adaptive learning.>&2;kill $(jobs -p)" SIGUSR1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you can remove this comment with the if above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

fi


response=$(curl 0.0.0.0:8000/process-video-cfg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This endpoint has recently been renamed to start-process-video

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

### Clone Neuralet Repository
Make sure you have the prerequisites and then clone this repository to your local system by running this command:
```
git clone https://github.com/neuralet/neuralet.git
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw you added several files for adaptive learning. Is it still necessary to clone from neuralet/neuralet?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it was just the copy of the original README, I changed it and referred to the original one for more details.

README.md Outdated
##### Run on AMD node with a connected Coral USB Accelerator with Adaptive Learning Support
Currently Smart Social Distancing supports Adaptive Learning framework on X86 nodes with connected USB TPU. for more information about Adaptive Learning visit [this page](https://github.com/neuralet/neuralet/tree/master/applications/adaptive-learning)
Important notes:
1. you must install [Docker Compose](https://github.com/docker/compose) to be able to use Adaptive Learning.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. you must install [Docker Compose](https://github.com/docker/compose) to be able to use Adaptive Learning.
1. You must install [Docker Compose](https://github.com/docker/compose) to be able to use Adaptive Learning.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

README.md Outdated
@@ -182,6 +182,23 @@ docker build -f x86-openvino.Dockerfile -t "neuralet/smart-social-distancing:lat
docker run -it -p HOST_PORT:8000 -v "$PWD/data":/repo/data -v "$PWD/config-x86-openvino.ini":/repo/config-x86-openvino.ini -v "$PWD/certificates/processor":/repo/certs -e TZ=`./timezone.sh` neuralet/smart-social-distancing:latest-x86_64_openvino
```

##### Run on AMD node with a connected Coral USB Accelerator with Adaptive Learning Support
Currently Smart Social Distancing supports Adaptive Learning framework on X86 nodes with connected USB TPU. for more information about Adaptive Learning visit [this page](https://github.com/neuralet/neuralet/tree/master/applications/adaptive-learning)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is https://github.com/neuralet/neuralet/tree/master/applications/adaptive-learning the same README than the one uploaded in adaptive-learning/README.md, if so please link to the smart-social-distance one

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I linked to the original code base in smart-social-distancing one since the original one is a general solution and smart-social-distancing is just a use case. Thanks.

config-coral.ini Outdated
Comment on lines 46 to 47
#wether repeat the video processing when video reached to its final frame or not.
Repeat = false
Copy link
Collaborator

@renzodgc renzodgc Nov 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#wether repeat the video processing when video reached to its final frame or not.
Repeat = false
# Whether to loop the video processing when video reached to its final frame or not.
Repeat = false

This config allows for starting all over the video once it's finished? Could we change the name of the config to something like LoopVideoFile. Something that's clear that affects only when consuming a video file after it finishes. And not a camera

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, you are right. Done

@@ -296,6 +298,10 @@ def process_video(self, video_uri):
frame_num += 1
if frame_num % 100 == 1:
logger.info(f'processed frame {frame_num} for {video_uri}')
if self.repeat == 'true' and frame_num % total_frames == 0:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the repeat parameter should be a boolean and init it using the function get_boolean from the config_engine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants