Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/EV_updates' into EV_updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Erick Verleye committed Jun 29, 2023
2 parents ddb0988 + e269377 commit 4af251e
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Use a base image with Conda pre-installed
FROM continuumio/miniconda3

# Copy the directory containing environment.yml into the Docker image
COPY ./ /app

# Change the working directory
WORKDIR /app

# Install Conda and create a new environment from environment.yml
RUN conda update -n base -c defaults conda && \
conda env create -f environment.yml

# Activate the created environment
RUN echo "conda activate b2p" >> ~/.bashrc
ENV PATH /opt/conda/envs/b2p/bin:$PATH
ENV PYTHONPATH /app:$PYTHONPATH
# Install JupyterLab
RUN conda install -n b2p jupyterlab

# Expose the port for JupyterLab
EXPOSE 8888

# Start JupyterLab
RUN chmod +x /app/entrypoint.sh
ENTRYPOINT ["/app/entrypoint.sh"]
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ aws:
torch:
inference:
batch_size: 100
num_workers: 12
num_workers: 5
2 changes: 2 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --NotebookApp.token=$JUPYTER_TOKEN --allow-root
4 changes: 3 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ dependencies:
- zipp=3.15.0=pyhd8ed1ab_0
- zlib=1.2.13=h166bdaf_4
- zstd=1.5.2=h3eb15da_6
- gdal==3.6.4
- pip:
- affine==2.4.0
- attrs==23.1.0
Expand All @@ -159,12 +160,12 @@ dependencies:
- cmake==3.26.3
- contourpy==1.0.7
- cycler==0.11.0
- chardet
- debugpy==1.6.7
- filelock==3.12.0
- fiona==1.9.3
- fonttools==4.39.3
- numpy==1.24.3
- gdal==3.6.4
- geographiclib==2.0
- geojson==3.0.1
- geopandas==0.13.0
Expand Down Expand Up @@ -235,3 +236,4 @@ dependencies:
- tzdata==2023.3
- urllib3==1.26.15
- xarray==2023.4.2
#prefix: /home/ec2-user/anaconda3/envs/b2p
2 changes: 1 addition & 1 deletion src/ml/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def inference_torch(model_file: TrainedModel, tile_match_file: Union[SingleRegio
output = model(data)
probs = torch.softmax(output, dim=1)
conf, pred = torch.max(probs, 1)

print(data.shape)
print(pred)

# store res to file
Expand Down

0 comments on commit 4af251e

Please sign in to comment.