Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit 96edd41

Browse files
authored
Merge pull request #109 from Azure-Samples/yadavm_factoryai
Yadavm factoryai
2 parents 9e3e396 + 5c912c1 commit 96edd41

File tree

218 files changed

+11083
-1694
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+11083
-1694
lines changed

factory-ai-vision/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ MANIFEST
4949
# PyInstaller
5050
# Usually these files are written by a python script from a template
5151
# before PyInstaller builds the exe, so as to inject date/other infos into it.
52-
*.manifest
52+
#*.manifest
5353
*.spec
5454

5555
# Installer logs

factory-ai-vision/10

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This will take min at normal connection speeds. Status can be checked on the Azure Stack Edge device

factory-ai-vision/EdgeSolution/deployment.cpu.template.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,18 @@
8888
"restartPolicy": "always",
8989
"settings": {
9090
"image": "${MODULES.InferenceModule.cpuamd64}",
91-
"createOptions": "{\"HostConfig\":{\"Binds\":[\"/tmp/.X11-unix:/tmp/.X11-unix\",\"/dev:/dev\"],\"NetworkMode\":\"host\",\"IpcMode\":\"host\",\"Privileged\":true},\"NetworkingConfig\":{\"EndpointsConfig\":{\"host\":{}}},\"Env\":[\"DISPLAY=:0\"]}"
91+
"createOptions": {
92+
"HostConfig": {
93+
"NetworkMode": "host",
94+
"runtime": "runc"
95+
},
96+
"NetworkingConfig": {
97+
"EndpointsConfig": {
98+
"host": {}
99+
}
100+
},
101+
"Env": ["DISPLAY=:0"]
102+
}
92103
}
93104
}
94105
}
@@ -97,7 +108,9 @@
97108
"$edgeHub": {
98109
"properties.desired": {
99110
"schemaVersion": "1.0",
100-
"routes": {},
111+
"routes": {
112+
"metrics": "FROM /messages/modules/InferenceModule/outputs/metrics INTO $upstream"
113+
},
101114
"storeAndForwardConfiguration": {
102115
"timeToLiveSecs": 7200
103116
}

factory-ai-vision/EdgeSolution/deployment.gpu.template.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,17 @@
8888
"restartPolicy": "always",
8989
"settings": {
9090
"image": "${MODULES.InferenceModule.gpuamd64}",
91-
"createOptions": "{\"HostConfig\":{\"Binds\":[\"/tmp/.X11-unix:/tmp/.X11-unix\",\"/dev:/dev\"],\"NetworkMode\":\"host\",\"IpcMode\":\"host\",\"Privileged\":true},\"NetworkingConfig\":{\"EndpointsConfig\":{\"host\":{}}},\"Env\":[\"DISPLAY=:0\"]}"
91+
"createOptions": {
92+
"HostConfig": {
93+
"NetworkMode": "host",
94+
"runtime": "nvidia"
95+
},
96+
"NetworkingConfig": {
97+
"EndpointsConfig": {
98+
"host": {}
99+
}
100+
}
101+
}
92102
}
93103
}
94104
}
@@ -97,7 +107,9 @@
97107
"$edgeHub": {
98108
"properties.desired": {
99109
"schemaVersion": "1.0",
100-
"routes": {},
110+
"routes": {
111+
"metrics": "FROM /messages/modules/InferenceModule/outputs/metrics INTO $upstream"
112+
},
101113
"storeAndForwardConfiguration": {
102114
"timeToLiveSecs": 7200
103115
}

factory-ai-vision/EdgeSolution/modules/InferenceModule/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ MANIFEST
2828
# PyInstaller
2929
# Usually these files are written by a python script from a template
3030
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31-
*.manifest
31+
#*.manifest
3232
*.spec
3333

3434
# Installer logs

factory-ai-vision/EdgeSolution/modules/InferenceModule/Dockerfile.cpuamd64

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/azureml/onnxruntime:latest-openvino-cpu
1+
FROM mcr.microsoft.com/azureml/onnxruntime:latest
22

33
WORKDIR /app
44

@@ -29,6 +29,7 @@ COPY object_detection.py ./
2929
COPY utility.py ./
3030
COPY default_model/cvexport.manifest default_model/
3131
COPY default_model default_model/
32+
COPY default_model_6parts default_model_6parts/
3233
COPY sample_video sample_video/
3334
RUN chmod 777 sample_video/video.mp4
3435
RUN chmod 777 default_model

factory-ai-vision/EdgeSolution/modules/InferenceModule/Dockerfile.gpuamd64

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,27 @@ ENV LC_ALL en_US.UTF-8
2727
ARG DEVICE
2828

2929
#Upgradin CUDA to 10.2
30-
RUn sudo apt-get install -y software-properties-common
31-
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-ubuntu1604.pin
32-
RUN sudo mv cuda-ubuntu1604.pin /etc/apt/preferences.d/cuda-repository-pin-600
33-
RUN sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
34-
RUN sudo add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/ /"
35-
RUN sudo apt-get update
36-
RUN sudo apt-get -y install cuda
30+
#RUN sudo apt-get install -y software-properties-common
31+
#RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-ubuntu1604.pin
32+
#RUN sudo mv cuda-ubuntu1604.pin /etc/apt/preferences.d/cuda-repository-pin-600
33+
#RUN sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
34+
#RUN sudo add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/ /"
35+
#RUN sudo apt-get update
36+
#RUN sudo apt-get -y install cuda
3737

3838
COPY requirements.txt ./
39-
RUN pip install -r requirements.txt && \
39+
RUN pip install --upgrade pip
40+
RUN pip install -U certifi --ignore-installed
41+
RUN pip install -r requirements.txt --ignore-installed && \
4042
pip install flask opencv-python onnx
43+
RUN pip install onnxruntime-gpu
4144

4245
COPY main.py ./
4346
COPY object_detection.py ./
4447
COPY utility.py ./
4548
COPY default_model/cvexport.manifest default_model/
4649
COPY default_model default_model/
50+
COPY default_model_6parts default_model_6parts/
4751
COPY sample_video sample_video/
4852
RUN chmod 777 sample_video/video.mp4
4953
RUN chmod 777 default_model
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Barrel
2+
Bottle
3+
Box
4+
Hammer
5+
Plastic bag
6+
Screwdriver
Binary file not shown.

0 commit comments

Comments
 (0)