Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Drexel 2022-2023 AIML Capstone - Digital Pathology
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zac Rahn
Drexel 2022-2023 AIML Capstone - Digital Pathology
Commits
8a2c12f6
Commit
8a2c12f6
authored
2 years ago
by
EC2 Default User
Browse files
Options
Downloads
Plain Diff
Merge branch 'main' of
https://gitlab.cci.drexel.edu/zr66/cs591-dpath
parents
fc759eb7
f273aea9
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
digpath/db/database_connection.py
+14
-11
14 additions, 11 deletions
digpath/db/database_connection.py
digpath/services/upload_service/diagnosis_provider.py
+4
-4
4 additions, 4 deletions
digpath/services/upload_service/diagnosis_provider.py
with
19 additions
and
15 deletions
.gitignore
+
1
−
0
View file @
8a2c12f6
...
...
@@ -5,3 +5,4 @@ __pycache__
models/
digpath.db
digpath.egg-info/
digpath/services/dpath/
This diff is collapsed.
Click to expand it.
digpath/db/database_connection.py
+
14
−
11
View file @
8a2c12f6
...
...
@@ -145,19 +145,22 @@ class DigpathDatabase:
return
results
def
get_requests
(
self
):
cursor
=
self
.
_db
.
cursor
().
execute
(
'
SELECT
*
FROM requests
'
)
cursor
=
self
.
_db
.
cursor
().
execute
(
'
SELECT
request_id
FROM requests
'
)
results
=
[]
for
i
in
cursor
.
fetchall
():
for
request
in
cursor
.
fetchall
():
request_id
=
request
[
0
]
data
=
self
.
get_request_info
(
request_id
)
item
=
{
'
request_id
'
:
i
[
0
]
,
'
file
'
:
i
[
1
],
'
diagnosis
'
:
i
[
2
],
'
total_chips
'
:
i
[
3
],
'
mild
'
:
i
[
4
],
'
moderate
'
:
i
[
5
],
'
severe
'
:
i
[
6
],
'
status
'
:
i
[
7
],
'
timestamp
'
:
i
[
8
]
'
request_id
'
:
request_id
,
'
file
'
:
data
[
'
file
'
],
'
diagnosis
'
:
data
[
'
diagnosis
'
],
'
total_chips
'
:
data
[
'
total_chips
'
],
'
mild
'
:
data
[
'
mild
'
],
'
moderate
'
:
data
[
'
moderate
'
],
'
severe
'
:
data
[
'
severe
'
],
'
status
'
:
data
[
'
status
'
],
'
timestamp
'
:
data
[
'
timestamp
'
]
}
results
.
append
(
item
)
return
results
This diff is collapsed.
Click to expand it.
digpath/services/upload_service/diagnosis_provider.py
+
4
−
4
View file @
8a2c12f6
...
...
@@ -27,7 +27,7 @@ class Provider:
return
response
.
json
()
def
get_images
(
self
,
report_id
):
report_id
=
'
fake_request_id
'
#
report_id = 'fake_request_id'
save_chip_path
=
f
'
../dpath/report/
{
report_id
}
/image
'
result
=
glob
.
glob
(
f
'
{
save_chip_path
}
/*.png
'
)[:
50
]
response
=
[]
...
...
@@ -39,7 +39,7 @@ class Provider:
s3_client
=
boto3
.
client
(
'
s3
'
)
s3_resource
=
boto3
.
resource
(
'
s3
'
)
image_bucket
=
s3_resource
.
Bucket
(
'
digpath-predictions
'
)
report_id
=
'
fake_request_id
'
#
report_id = 'fake_request_id'
save_chip_path
=
f
'
../dpath/report/
{
report_id
}
/image
'
dowloaded_files
=
glob
.
glob
(
f
'
{
save_chip_path
}
/*.png
'
)
prefix
=
f
'
{
report_id
}
/severe_predictions/
'
...
...
@@ -47,7 +47,7 @@ class Provider:
if
not
os
.
path
.
exists
(
save_chip_path
):
os
.
makedirs
(
save_chip_path
)
for
s3_obj
in
image_bucket
.
objects
.
filter
(
Prefix
=
prefix
):
for
s3_obj
in
list
(
image_bucket
.
objects
.
filter
(
Prefix
=
prefix
)
)[:
50
]
:
if
s3_obj
.
key
==
prefix
:
continue
...
...
@@ -60,7 +60,7 @@ class Provider:
return
SAVE_DIRECTORY
+
image_name
def
get_image_path
(
self
,
report_id
,
image_name
)
:
report_id
=
'
fake_request_id
'
#
report_id = 'fake_request_id'
return
f
'
{
os
.
getcwd
()
}
/../dpath/report/
{
report_id
}
/image/
{
image_name
}
'
.
replace
(
'
\\
'
,
'
/
'
)
def
__save_local_file
(
self
,
file
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment