> For the complete documentation index, see [llms.txt](https://alfredo-reyes-montero.gitbook.io/docker/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alfredo-reyes-montero.gitbook.io/docker/application/imagerecognition/build-and-run.md).

# Build  & Run

## Build & Run

Once we have clone the repository we need to execute the next commands:

```
$ cd Docker/ImageRecognition
$ docker build -t xiaomin .
```

Here we need to wait a couples of minutes, meanwhile all the container is created.

Then once this have finish we need to :

```
$ sh run.sh
```

This will run the container and give use access to it. Let´s explain a this file.

run.sh

This will help us (optional) for displaying images with cv.imshow()

```
xhost +local:docker
```

In this command we need to make sure to give the camera as a parameters so container could use it.

```
sudo docker run -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --device /dev/video0 xiaomin
```

Once that we are on the docker terminal. We could access to this 3 example by executing the command that correspond.

We could find this at howtorun.txt

```
On Docker / terminal

$ source Setup/config.sh

Face Detection
$ python3 Scripts/ImageRecognition/FaceDection/faces.py 

Object Tracking
python3 Scripts/ImageRecognition/TrackObject/objectdata.py --filter HSV --webcam
python Scripts/ImageRecognition/TrackObject/object_movement.py

Real-time object detect
python Scripts/ImageRecognition/RealtimeObjectDetection/realDetectionl.py --prototxt MobileNetSSD_deploy.prototxt.txt --model MobileNetSSD_deploy.caffemodel
```

## Docker execute

We could also access to this docker by executing

```
docker
```
