Kiran5 commited on
Commit
0bb06a1
·
1 Parent(s): 0bc88e3

Add application file

Browse files
Dockerfile ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9
2
+
3
+ # Create a user to run the app
4
+ RUN useradd -m -u 1000 user
5
+ USER user
6
+ ENV PATH="/home/user/.local/bin:$PATH"
7
+
8
+ # Set the working directory to root (default is root, no need to set it explicitly)
9
+ WORKDIR /
10
+
11
+ # Copy the requirements.txt file
12
+ COPY --chown=user ./requirements/requirement.txt requirements/requirement.txt
13
+
14
+ # Copy the necessary libraries (if required)
15
+ COPY --chown=user ./lib/aicloudlibs-0.1.0-py3-none-any.whl /lib/
16
+ COPY --chown=user ./lib/en_core_web_lg-3.7.1-py3-none-any.whl /lib/
17
+
18
+ # You can add other .whl files similarly if needed
19
+ # COPY --chown=user ./lib/better_profanity-2.0.0-py3-none-any.whl /lib/
20
+ # COPY --chown=user ./lib/privacy-1.0.9-py3-none-any.whl /lib/
21
+
22
+ # Install dependencies
23
+ RUN pip install --no-cache-dir --upgrade -r requirements/requirement.txt
24
+
25
+ # Copy the src folder directly into the root directory
26
+ COPY --chown=user ./src /src
27
+ COPY --chown=user ./config /config
28
+ COPY --chown=user ./presidio_analyzer /presidio_analyzer
29
+ COPY --chown=user ./lib /lib
30
+ COPY --chown=user ./requirements /requirements
31
+
32
+ # Set PYTHONPATH to include /src so Python can find llm_explain
33
+ ENV PYTHONPATH="/src:$PYTHONPATH"
34
+
35
+ # Expose the port (default for Hugging Face is 7860)
36
+ EXPOSE 7860
37
+
38
+ # CMD to run the FastAPI app with Uvicorn
39
+ CMD ["uvicorn", "src.privacy_main:app", "--host", "0.0.0.0", "--port", "7860"]
config/filemetadata.yaml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ openapi_url: /rai/v1/privacy-files/openapi.json
2
+ docs_url: /rai/v1/privacy-files/docs
3
+ title: Infosys Responsible AI - responsible-ai-privacy - OpenAPI 3.0
4
+ description: API specs for Infosys Responsible AI Privacy pillar in OpenAPI 3.0 format
5
+ terms_of_service: https://www.infosys.com
6
+ contact:
7
8
+ license_info:
9
+ name: Infosys
10
+ url: https://www.infosys.com
11
+ version: v$version
12
+ openapi_tags:
13
+ - name: PII File Privacy
14
+ description: Operations required for a PII entity (e.g. IN_ADHAAR, IN_PAN, US_SSN etc) from video
15
+ externalDocs:
16
+ description: Find out more
17
+ url: https://www.infosys.com
config/metadata.yaml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ openapi_url: /v1/privacy/openapi.json
2
+ docs_url: /v1/privacy/docs
3
+ title: Infosys Responsible AI - responsible-ai-privacy - OpenAPI 3.0
4
+ description: API specs for Infosys Responsible AI Privacy pillar in OpenAPI 3.0 format
5
+ terms_of_service: https://www.infosys.com
6
+ contact:
7
8
+ license_info:
9
+ name: Infosys
10
+ url: https://www.infosys.com
11
+ version: v$version
12
+ openapi_tags:
13
+ - name: PII Privacy
14
+ description: Operations required for a PII entity (e.g. IN_ADHAAR, IN_PAN, US_SSN etc)
15
+ externalDocs:
16
+ description: Find out more
17
+ url: https://www.infosys.com
requirements/blackduck.bat ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ C:\Python\Python3.9.13\Python3.9.13\python.exe -m venv p_env
2
+ p_env\scripts\activate & pip install -r requirements-blackduck.txt --index-url https://infyartifactory.ad.infosys.com/artifactory/api/pypi/pypi-remote/simple --trusted-host infyartifactory.ad.infosys.com
requirements/requirement.txt ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ fastapi
2
+ pydantic
3
+ #pymongo
4
+ Xeger
5
+ Faker
6
+ python-dotenv
7
+ uvicorn
8
+ pandas
9
+ openpyxl
10
+ xlsxwriter
11
+ presidio_anonymizer
12
+ presidio_image_redactor==0.0.48
13
+ python-multipart
14
+ pyyaml
15
+ regex
16
+ opencv-python-headless
17
+ Faker
18
+ ultralytics
19
+ omegaconf
20
+ anyio
21
+ blis
22
+ catalogue
23
+ certifi
24
+ charset-normalizer
25
+ click
26
+ colorama
27
+ confection
28
+ contourpy
29
+ cycler
30
+ cymem
31
+ fastapi
32
+ FastAPI-SQLAlchemy
33
+ filelock
34
+ fonttools
35
+ diffprivlib
36
+ greenlet
37
+ h11
38
+ idna
39
+ Jinja2
40
+ kiwisolver
41
+ langcodes
42
+ MarkupSafe
43
+ matplotlib
44
+ murmurhash
45
+ numpy
46
+ packaging
47
+ pathy
48
+ phonenumbers
49
+ Pillow
50
+ pip
51
+ preshed
52
+ #presidio-analyzer
53
+ presidio-anonymizer
54
+ presidio-image-redactor==0.0.48
55
+ pycryptodome
56
+ pydantic
57
+ pydicom
58
+ pyparsing
59
+ pypng
60
+ pytesseract
61
+ python-dateutil
62
+ python-multipart
63
+ PyYAML
64
+ regex
65
+ requests
66
+ requests-file
67
+ setuptools
68
+ six
69
+ smart-open
70
+ sniffio
71
+ spacy
72
+ spacy-legacy
73
+ spacy-loggers
74
+ SQLAlchemy
75
+ srsly
76
+ starlette
77
+ thinc
78
+ tldextract
79
+ tqdm
80
+ typer
81
+ typing_extensions
82
+ urllib3
83
+ uvicorn
84
+ wasabi
85
+ httpx
86
+ opencv-python-headless
87
+ numpy
88
+
89
+ PyYAML>=5.3.1
90
+ requests>=2.23.0
91
+ scipy>=1.4.1
92
+ torch>=1.7.0,!=1.12.0
93
+ torchvision>=0.8.1,!=0.13.0
94
+ tqdm>=4.41.0
95
+ protobuf<4.21.3
96
+ # Logging -------------------------------------
97
+ tensorboard>=2.4.1
98
+
99
+ seaborn>=0.11.0
100
+
101
+
102
+ thop # FLOPs computation
103
+ #https://huggingface.co/spacy/en_core_web_lg/resolve/main/en_core_web_lg-any-py3-none-any.whl
104
+ # lib/presidio_analyzer-4.1.0-py3-none-any.whl
105
+ lib/aicloudlibs-0.1.0-py3-none-any.whl
106
+ lib/en_core_web_lg-3.7.1-py3-none-any.whl
107
+
108
+
109
+ easyocr
110
+ # Base ----------------------------------------
111
+
112
+ numpy>=1.18.5
113
+
114
+ PyYAML>=5.3.1
115
+ requests>=2.23.0
116
+ scipy>=1.4.1
117
+ torch>=1.7.0,!=1.12.0
118
+ torchvision>=0.8.1,!=0.13.0
119
+ tqdm>=4.41.0
120
+ protobuf<4.21.3
121
+
122
+ # Logging -------------------------------------
123
+ tensorboard>=2.4.1
124
+
125
+ seaborn>=0.11.0
126
+ regex
127
+ tqdm
128
+ pandas
129
+ datasets
130
+ detect_secrets
131
+ gibberish_detector
132
+ huggingface_hub
133
+ nltk
134
+ scikit-learn
135
+ seqeval
136
+ transformers
137
+ datasets
138
+ transformers
139
+ evaluate
140
+ seqeval
141
+ autopep8
142
+
143
+ # face detection
144
+ # tensorflow
145
+
146
+ opencv-python
147
+ pyjwt
148
+ python-jose[cryptography]
requirements/requirement_blackduck.txt ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ fastapi
3
+ pydantic
4
+ #pymongo
5
+ Xeger
6
+ Faker
7
+ python-dotenv
8
+ uvicorn
9
+ pandas
10
+ openpyxl
11
+ xlsxwriter
12
+ presidio_anonymizer
13
+ presidio_image_redactor==0.0.48
14
+ python-multipart
15
+ pyyaml
16
+ regex
17
+ opencv-python-headless
18
+ Faker
19
+ ultralytics
20
+ omegaconf
21
+ anyio
22
+ blis
23
+ catalogue
24
+ certifi
25
+ charset-normalizer
26
+ click
27
+ colorama
28
+ confection
29
+ contourpy
30
+ cycler
31
+ cymem
32
+ fastapi
33
+ FastAPI-SQLAlchemy
34
+ filelock
35
+ fonttools
36
+ diffprivlib
37
+ greenlet
38
+ h11
39
+ idna
40
+ Jinja2
41
+ kiwisolver
42
+ langcodes
43
+ MarkupSafe
44
+ matplotlib
45
+ murmurhash
46
+ numpy
47
+ packaging
48
+ pathy
49
+ phonenumbers
50
+ Pillow
51
+ pip
52
+ preshed
53
+ #presidio-analyzer
54
+ presidio-anonymizer
55
+ presidio-image-redactor==0.0.48
56
+ pycryptodome
57
+ pydantic
58
+ pydicom
59
+ pyparsing
60
+ pypng
61
+ pytesseract
62
+ python-dateutil
63
+ python-multipart
64
+ PyYAML
65
+ regex
66
+ requests
67
+ requests-file
68
+ setuptools
69
+ six
70
+ smart-open
71
+ sniffio
72
+ spacy
73
+ spacy-legacy
74
+ spacy-loggers
75
+ SQLAlchemy
76
+ srsly
77
+ starlette
78
+ thinc
79
+ tldextract
80
+ tqdm
81
+ typer
82
+ typing_extensions
83
+ urllib3
84
+ uvicorn
85
+ wasabi
86
+ httpx
87
+ opencv-python-headless
88
+ numpy
89
+ # numpy>=1.18.5
90
+ # opencv-python>=4.1.1
91
+ # Pillow>=7.1.2
92
+ PyYAML>=5.3.1
93
+ requests>=2.23.0
94
+ scipy>=1.4.1
95
+ torch>=1.7.0,!=1.12.0
96
+ torchvision>=0.8.1,!=0.13.0
97
+ tqdm>=4.41.0
98
+ protobuf<4.21.3
99
+ # Logging -------------------------------------
100
+ tensorboard>=2.4.1
101
+ # wandb
102
+
103
+ # Plotting ------------------------------------
104
+ # pandas>=1.1.4
105
+ seaborn>=0.11.0
106
+
107
+ # Export --------------------------------------
108
+ # coremltools>=4.1 # CoreML export
109
+ # onnx>=1.9.0 # ONNX export
110
+ # onnx-simplifier>=0.3.6 # ONNX simplifier
111
+ # scikit-learn==0.19.2 # CoreML quantization
112
+ # tensorflow>=2.4.1 # TFLite export
113
+ # tensorflowjs>=3.9.0 # TF.js export
114
+ # openvino-dev # OpenVINO export
115
+
116
+ # Extras --------------------------------------
117
+ # ipython # interactive notebook
118
+ # psutil # system utilization
119
+ thop # FLOPs computation
120
+ #https://huggingface.co/spacy/en_core_web_lg/resolve/main/en_core_web_lg-any-py3-none-any.whl
121
+ # lib/presidio_analyzer-4.1.0-py3-none-any.whl
122
+ ../lib/aicloudlibs-0.1.0-py3-none-any.whl
123
+ # lib/en_core_web_lg-3.7.1-py3-none-any.whl
124
+
125
+ presidio_analyzer
126
+ # Usage: pip install -r requirements.txt
127
+ easyocr
128
+ # Base ----------------------------------------
129
+ # matplotlib>=3.2.2
130
+ numpy>=1.18.5
131
+ # opencv-python>=4.1.1
132
+ # Pillow>=7.1.2
133
+ PyYAML>=5.3.1
134
+ requests>=2.23.0
135
+ scipy>=1.4.1
136
+ torch>=1.7.0,!=1.12.0
137
+ torchvision>=0.8.1,!=0.13.0
138
+ tqdm>=4.41.0
139
+ protobuf<4.21.3
140
+
141
+ # Logging -------------------------------------
142
+ tensorboard>=2.4.1
143
+ # wandb
144
+
145
+ # Plotting ------------------------------------
146
+ # pandas>=1.1.4
147
+ seaborn>=0.11.0
148
+
149
+ # Export --------------------------------------
150
+ # coremltools>=4.1 # CoreML export
151
+ # onnx>=1.9.0 # ONNX export
152
+ # onnx-simplifier>=0.3.6 # ONNX simplifier
153
+ # scikit-learn==0.19.2 # CoreML quantization
154
+ # tensorflow>=2.4.1 # TFLite export
155
+ # tensorflowjs>=3.9.0 # TF.js export
156
+ # openvino-dev # OpenVINO export
157
+
158
+ # Extras --------------------------------------
159
+ # ipython # interactive notebook
160
+ # psutil # system utilization
161
+ thop # FLOPs computation
162
+ # albumentations>=1.0.3
163
+ # pycocotools>=2.0 # COCO mAP
164
+ # roboflow
165
+
166
+ # code pii
167
+ regex
168
+ tqdm
169
+ pandas
170
+ datasets
171
+ detect_secrets
172
+ gibberish_detector
173
+ huggingface_hub
174
+ nltk
175
+ scikit-learn
176
+ seqeval
177
+ transformers
178
+ datasets
179
+ transformers
180
+ evaluate
181
+ seqeval
182
+ autopep8
183
+
184
+ # face detection
185
+ # tensorflow
186
+
187
+ opencv-python
188
+ pyjwt
189
+ python-jose[cryptography]
requirements/requirements-blackduck.txt ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ fastapi
3
+ pydantic
4
+ #pymongo
5
+ Xeger
6
+ Faker
7
+ python-dotenv
8
+ uvicorn
9
+ pandas
10
+ openpyxl
11
+ xlsxwriter
12
+ presidio_anonymizer
13
+ presidio_image_redactor==0.0.48
14
+ python-multipart
15
+ pyyaml
16
+ regex
17
+ opencv-python-headless
18
+ Faker
19
+ ultralytics
20
+ omegaconf
21
+ anyio
22
+ blis
23
+ catalogue
24
+ certifi
25
+ charset-normalizer
26
+ click
27
+ colorama
28
+ confection
29
+ contourpy
30
+ cycler
31
+ cymem
32
+ fastapi
33
+ FastAPI-SQLAlchemy
34
+ filelock
35
+ fonttools
36
+ diffprivlib
37
+ greenlet
38
+ h11
39
+ idna
40
+ Jinja2
41
+ kiwisolver
42
+ langcodes
43
+ MarkupSafe
44
+ matplotlib
45
+ murmurhash
46
+ numpy
47
+ packaging
48
+ pathy
49
+ phonenumbers
50
+ Pillow
51
+ pip
52
+ preshed
53
+ #presidio-analyzer
54
+ presidio-anonymizer
55
+ presidio-image-redactor==0.0.48
56
+ pycryptodome
57
+ pydantic
58
+ pydicom
59
+ pyparsing
60
+ pypng
61
+ pytesseract
62
+ python-dateutil
63
+ python-multipart
64
+ PyYAML
65
+ regex
66
+ requests
67
+ requests-file
68
+ setuptools
69
+ six
70
+ smart-open
71
+ sniffio
72
+ spacy
73
+ spacy-legacy
74
+ spacy-loggers
75
+ SQLAlchemy
76
+ srsly
77
+ starlette
78
+ thinc
79
+ tldextract
80
+ tqdm
81
+ typer
82
+ typing_extensions
83
+ urllib3
84
+ uvicorn
85
+ wasabi
86
+ httpx
87
+ opencv-python-headless
88
+ numpy
89
+ # numpy>=1.18.5
90
+ # opencv-python>=4.1.1
91
+ # Pillow>=7.1.2
92
+ PyYAML>=5.3.1
93
+ requests>=2.23.0
94
+ scipy>=1.4.1
95
+ torch>=1.7.0,!=1.12.0
96
+ torchvision>=0.8.1,!=0.13.0
97
+ tqdm>=4.41.0
98
+ protobuf<4.21.3
99
+ # Logging -------------------------------------
100
+ tensorboard>=2.4.1
101
+ # wandb
102
+
103
+ # Plotting ------------------------------------
104
+ # pandas>=1.1.4
105
+ seaborn>=0.11.0
106
+
107
+ # Export --------------------------------------
108
+ # coremltools>=4.1 # CoreML export
109
+ # onnx>=1.9.0 # ONNX export
110
+ # onnx-simplifier>=0.3.6 # ONNX simplifier
111
+ # scikit-learn==0.19.2 # CoreML quantization
112
+ # tensorflow>=2.4.1 # TFLite export
113
+ # tensorflowjs>=3.9.0 # TF.js export
114
+ # openvino-dev # OpenVINO export
115
+
116
+ # Extras --------------------------------------
117
+ # ipython # interactive notebook
118
+ # psutil # system utilization
119
+ thop # FLOPs computation
120
+ #https://huggingface.co/spacy/en_core_web_lg/resolve/main/en_core_web_lg-any-py3-none-any.whl
121
+ # lib/presidio_analyzer-4.1.0-py3-none-any.whl
122
+ ../lib/aicloudlibs-0.1.0-py3-none-any.whl
123
+ # lib/en_core_web_lg-3.7.1-py3-none-any.whl
124
+
125
+ presidio_analyzer
126
+ # Usage: pip install -r requirements.txt
127
+ easyocr
128
+ # Base ----------------------------------------
129
+ # matplotlib>=3.2.2
130
+ numpy>=1.18.5
131
+ # opencv-python>=4.1.1
132
+ # Pillow>=7.1.2
133
+ PyYAML>=5.3.1
134
+ requests>=2.23.0
135
+ scipy>=1.4.1
136
+ torch>=1.7.0,!=1.12.0
137
+ torchvision>=0.8.1,!=0.13.0
138
+ tqdm>=4.41.0
139
+ protobuf<4.21.3
140
+
141
+ # Logging -------------------------------------
142
+ tensorboard>=2.4.1
143
+ # wandb
144
+
145
+ # Plotting ------------------------------------
146
+ # pandas>=1.1.4
147
+ seaborn>=0.11.0
148
+
149
+ # Export --------------------------------------
150
+ # coremltools>=4.1 # CoreML export
151
+ # onnx>=1.9.0 # ONNX export
152
+ # onnx-simplifier>=0.3.6 # ONNX simplifier
153
+ # scikit-learn==0.19.2 # CoreML quantization
154
+ # tensorflow>=2.4.1 # TFLite export
155
+ # tensorflowjs>=3.9.0 # TF.js export
156
+ # openvino-dev # OpenVINO export
157
+
158
+ # Extras --------------------------------------
159
+ # ipython # interactive notebook
160
+ # psutil # system utilization
161
+ thop # FLOPs computation
162
+ # albumentations>=1.0.3
163
+ # pycocotools>=2.0 # COCO mAP
164
+ # roboflow
165
+
166
+ # code pii
167
+ regex
168
+ tqdm
169
+ pandas
170
+ datasets
171
+ detect_secrets
172
+ gibberish_detector
173
+ huggingface_hub
174
+ nltk
175
+ scikit-learn
176
+ seqeval
177
+ transformers
178
+ datasets
179
+ transformers
180
+ evaluate
181
+ seqeval
182
+ autopep8
183
+
184
+ # face detection
185
+ # tensorflow
186
+
187
+ opencv-python
188
+ pyjwt
189
+ python-jose[cryptography]