alessandro trinca tornidor commited on
Commit
606a7d7
·
1 Parent(s): 893aaca

refactor: sam-quantized submodule now referrenced without symlinks, update dockerfile

Browse files
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM registry.gitlab.com/aletrn/gis-prediction:1.11.7
2
 
3
  # Include global arg in this stage of the build
4
  ARG WORKDIR_ROOT="/var/task"
 
1
+ FROM registry.gitlab.com/aletrn/gis-prediction:1.11.8
2
 
3
  # Include global arg in this stage of the build
4
  ARG WORKDIR_ROOT="/var/task"
README.md CHANGED
@@ -15,9 +15,8 @@ I tested these instructions on macOS, but should work on linux as well.
15
  ## Segment Anything models
16
 
17
  It's possible to prepare the model files using <https://github.com/vietanhdev/samexporter/> or using the ones
18
- from <https://huggingface.co/aletrn/sam-quantized> (copy them within the folder `/machine_learning_models`).
19
-
20
- In this case after the clone of this repository it's best to initialize the `sam-quantized` submodule:
21
 
22
  ```bash
23
  git submodule update --init --recursive
 
15
  ## Segment Anything models
16
 
17
  It's possible to prepare the model files using <https://github.com/vietanhdev/samexporter/> or using the ones
18
+ from <https://huggingface.co/aletrn/sam-quantized>. By default the project contains that submodule.
19
+ If you want to use this (recommended) after the clone of this repository it's best to initialize the `sam-quantized` submodule:
 
20
 
21
  ```bash
22
  git submodule update --init --recursive
app.py CHANGED
@@ -23,7 +23,7 @@ from starlette.responses import JSONResponse
23
  load_dotenv()
24
  project_root_folder = Path(globals().get("__file__", "./_")).absolute().parent
25
  workdir = os.getenv("WORKDIR", project_root_folder)
26
- model_folder = Path(project_root_folder / "machine_learning_models")
27
 
28
  log_level = os.getenv("LOG_LEVEL", "INFO")
29
  setup_logging(log_level=log_level)
 
23
  load_dotenv()
24
  project_root_folder = Path(globals().get("__file__", "./_")).absolute().parent
25
  workdir = os.getenv("WORKDIR", project_root_folder)
26
+ model_folder = Path(project_root_folder / "sam-quantized" / "machine_learning_models")
27
 
28
  log_level = os.getenv("LOG_LEVEL", "INFO")
29
  setup_logging(log_level=log_level)
dockerfiles/dockerfile-samgis-base-with-lambda-support CHANGED
@@ -126,6 +126,6 @@ FROM runtime
126
  ARG FASTAPI_STATIC
127
  RUN mkdir ${FASTAPI_STATIC}
128
 
129
- COPY ./machine_learning_models ${LAMBDA_TASK_ROOT}/machine_learning_models
130
  COPY --from=node_prod_deps /appnode/node_modules* ${FASTAPI_STATIC}/node_modules
131
  COPY --from=node_build /appnode/dist* ${FASTAPI_STATIC}/dist
 
126
  ARG FASTAPI_STATIC
127
  RUN mkdir ${FASTAPI_STATIC}
128
 
129
+ COPY ./sam-quantized/machine_learning_models ${LAMBDA_TASK_ROOT}/machine_learning_models
130
  COPY --from=node_prod_deps /appnode/node_modules* ${FASTAPI_STATIC}/node_modules
131
  COPY --from=node_build /appnode/dist* ${FASTAPI_STATIC}/dist
docs/conf.py CHANGED
@@ -43,7 +43,7 @@ typehints_defaults = "comma"
43
 
44
  templates_path = ['_templates']
45
  exclude_patterns = [
46
- '_build', 'Thumbs.db', '.DS_Store', 'build/*', 'machine_learning_models', 'machine_learning_models/*'
47
  ]
48
 
49
  source_suffix = {
 
43
 
44
  templates_path = ['_templates']
45
  exclude_patterns = [
46
+ '_build', 'Thumbs.db', '.DS_Store', 'build/*', 'machine_learning_models', 'machine_learning_models/*', "sam-quantized/machine_learning_models", "sam-quantized/machine_learning_models/*"
47
  ]
48
 
49
  source_suffix = {
machine_learning_models DELETED
@@ -1 +0,0 @@
1
- sam-quantized/machine_learning_models