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

Bash scripts to use ncap-livestream #30

Open
wants to merge 2 commits into
base: reorganize
Choose a base branch
from

Conversation

curibe
Copy link

@curibe curibe commented Oct 25, 2021

Bash script to run webrtc and rtsp in neurocaas pipeline

Bash scripts are created to run webrtc and rtsp on the ec2 server deployed by the neurocaas pipeline.

Test locally

The test is performed on a local machine, in order to validate the operation of each script:

  • Download of the 'loaded' data to the s3 folder. This step emulates the process of uploading the files to the s3 bucket.
  • Execute each server.

This requires to have installed the repos containing the solution of webrtc and rtsp (in the rtmp-livestream branch).

The data used are:

  • DLCLive model: DLC_Dog_resnet_50_iteration-0_shuffle-0.tar.gz
  • Configuration file required by DLCLive: dlc_config,json
  • Yaml configuration file to run RTSP: config_rtsp.yml
  • Configuration file read by the webrtc server. It is similar to the one used by dlclive: dlc_config,json

Each of these configuration files are located in the repo of each solution.

WEBRTC

To test webrtc locally, we proceeded as follows:

  • Create a temporal folder, s3 folder to save the pipeline process
mkdir tmp
mkdir -p s3/results
  • Initialize the job
neurocaas-contrib workflow initialize-job -p ./tmp
  • Register the dataset, config file and result path. You need to have the data model downloaded
neurocaas-contrib workflow register-dataset -l ./DLC_Dog_resnet_50_iteration-0_shuffle-0.tar.gz
neurocaas-contrib workflow register-config -l ./dlc_config.json
neurocaas-contrib workflow register-resultpath -l s3/results
  • Change permission to script
chmod 700 run_webrtc_local.sh
  • Run the script locally
neurocaas-contrib workflow log-command-local -c ./run_webrtc_local.sh

RTSP

To test rtsp locally, we proceeded as follows:

  • Create a temporal folder, s3 folder to save the pipeline process
mkdir tmp
mkdir -p s3/results
  • Initialize the job
neurocaas-contrib workflow initialize-job -p ./tmp
  • Register the dataset, config file and result path. You need to have the data model downloaded.
    neurocaas_contrib only allows to register one data file and one configuration file. In this case, we need to manage a configuration file that allows to control the input parameters of the server script, as well as another configuration file that reads the server to manage other parameters. To implement this, the bash script that runs the server receives:

    • A yaml file as a configuration file (config_rtsp.yml):
    send: video
    cfg_filename: dlc_config.json
    path_cfg_file: Documents/DeepLabCut-live-GUI/config/
    model_file: DLC_Dog_resnet_50_iteration-0_shuffle-0.tar.gz
    • A zip file (rtsp_input.zip) with the model data (DLC_Dog_resnet_50_iteration-0_shuffle-0.tar.gz) and the configuration file it requires (dlc_config.json).

To register the files, we proceed in the same way

neurocaas-contrib workflow register-dataset -l rtsp_input.zip
neurocaas-contrib workflow register-config -l config_rtsp.yml
neurocaas-contrib workflow register-resultpath -l s3/results
  • Change permission to script
chmod 700 run_rtsp_zmq_local.sh
  • Run the script locally
neurocaas-contrib workflow log-command-local -c ./run_rtsp_zmq_local.sh

NOTE :
The difference between the files run_*_cli.sh (committed) and run_*_local.sh (mentioned here) is the path indicated in the userhome variable

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.

1 participant