Spaces:
Sleeping
Sleeping
Updating CSV file
Browse files- .idea/.gitignore +3 -0
- .idea/density_mapper_1.iml +10 -0
- .idea/inspectionProfiles/profiles_settings.xml +6 -0
- .idea/misc.xml +4 -0
- .idea/modules.xml +8 -0
- .idea/vcs.xml +6 -0
- app.py +14 -0
.idea/.gitignore
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Default ignored files
|
| 2 |
+
/shelf/
|
| 3 |
+
/workspace.xml
|
.idea/density_mapper_1.iml
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<module type="PYTHON_MODULE" version="4">
|
| 3 |
+
<component name="NewModuleRootManager">
|
| 4 |
+
<content url="file://$MODULE_DIR$">
|
| 5 |
+
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
| 6 |
+
</content>
|
| 7 |
+
<orderEntry type="jdk" jdkName="Python 3.9 (density_mapper_1)" jdkType="Python SDK" />
|
| 8 |
+
<orderEntry type="sourceFolder" forTests="false" />
|
| 9 |
+
</component>
|
| 10 |
+
</module>
|
.idea/inspectionProfiles/profiles_settings.xml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<component name="InspectionProjectProfileManager">
|
| 2 |
+
<settings>
|
| 3 |
+
<option name="USE_PROJECT_PROFILE" value="false" />
|
| 4 |
+
<version value="1.0" />
|
| 5 |
+
</settings>
|
| 6 |
+
</component>
|
.idea/misc.xml
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<project version="4">
|
| 3 |
+
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9 (density_mapper_1)" project-jdk-type="Python SDK" />
|
| 4 |
+
</project>
|
.idea/modules.xml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<project version="4">
|
| 3 |
+
<component name="ProjectModuleManager">
|
| 4 |
+
<modules>
|
| 5 |
+
<module fileurl="file://$PROJECT_DIR$/.idea/density_mapper_1.iml" filepath="$PROJECT_DIR$/.idea/density_mapper_1.iml" />
|
| 6 |
+
</modules>
|
| 7 |
+
</component>
|
| 8 |
+
</project>
|
.idea/vcs.xml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<project version="4">
|
| 3 |
+
<component name="VcsDirectoryMappings">
|
| 4 |
+
<mapping directory="" vcs="Git" />
|
| 5 |
+
</component>
|
| 6 |
+
</project>
|
app.py
CHANGED
|
@@ -3,6 +3,7 @@ import os
|
|
| 3 |
import numpy as np
|
| 4 |
import cv2 as cv
|
| 5 |
import csv
|
|
|
|
| 6 |
|
| 7 |
def set_min_dense_1(max_dense_0):
|
| 8 |
global scaled_thresh1
|
|
@@ -28,6 +29,17 @@ def set_min_dense_3(max_dense_2):
|
|
| 28 |
dense_3 = np.where(((textured_cxr<255) & (textured_cxr>=scaled_thresh3)), textured_cxr, 0)
|
| 29 |
return max_dense_2, dense_2, dense_3
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
def new__cxr(max_dense_0, max_dense_1, max_dense_2):
|
| 32 |
global textured_cxr, lung_noised, max_val, cxr, mask, scaled_thresh1, scaled_thresh2, scaled_thresh3, image_id, index, count
|
| 33 |
index += 1
|
|
@@ -93,6 +105,8 @@ def create_csv():
|
|
| 93 |
writer.writeheader()
|
| 94 |
# image_id, index = divmod(count, 3)
|
| 95 |
# image_id += 1
|
|
|
|
|
|
|
| 96 |
|
| 97 |
def check_auth(username, password):
|
| 98 |
global user, fresh_start
|
|
|
|
| 3 |
import numpy as np
|
| 4 |
import cv2 as cv
|
| 5 |
import csv
|
| 6 |
+
import git
|
| 7 |
|
| 8 |
def set_min_dense_1(max_dense_0):
|
| 9 |
global scaled_thresh1
|
|
|
|
| 29 |
dense_3 = np.where(((textured_cxr<255) & (textured_cxr>=scaled_thresh3)), textured_cxr, 0)
|
| 30 |
return max_dense_2, dense_2, dense_3
|
| 31 |
|
| 32 |
+
def commit_and_push_changes(repo_path, commit_message):
|
| 33 |
+
try:
|
| 34 |
+
repo = git.Repo(repo_path)
|
| 35 |
+
repo.git.add(update=True)
|
| 36 |
+
repo.git.commit(m=commit_message)
|
| 37 |
+
origin = repo.remote(name='origin')
|
| 38 |
+
origin.push()
|
| 39 |
+
print("Changes committed and pushed successfully!")
|
| 40 |
+
except Exception as e:
|
| 41 |
+
print("Error committing and pushing changes:", e)
|
| 42 |
+
|
| 43 |
def new__cxr(max_dense_0, max_dense_1, max_dense_2):
|
| 44 |
global textured_cxr, lung_noised, max_val, cxr, mask, scaled_thresh1, scaled_thresh2, scaled_thresh3, image_id, index, count
|
| 45 |
index += 1
|
|
|
|
| 105 |
writer.writeheader()
|
| 106 |
# image_id, index = divmod(count, 3)
|
| 107 |
# image_id += 1
|
| 108 |
+
commit_message = "Updating CSV file"
|
| 109 |
+
commit_and_push_changes(os.getcwd(), commit_message)
|
| 110 |
|
| 111 |
def check_auth(username, password):
|
| 112 |
global user, fresh_start
|