Skip to content

Commit

Permalink
update which notebooks are in this repo and gitignore/dockerignore, a…
Browse files Browse the repository at this point in the history
…dd github workflow
  • Loading branch information
rwood-97 committed Nov 8, 2024
1 parent 4f27328 commit c154d0d
Show file tree
Hide file tree
Showing 253 changed files with 3,288 additions and 30,141 deletions.
23 changes: 21 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,21 @@
maps
test.ipynb
# classification one inch
worked_examples/geospatial/*classification_one_inch_maps/*
!worked_examples/geospatial/*classification_one_inch_maps/Pipeline.ipynb
!worked_examples/geospatial/*classification_one_inch_maps/annotations_one_inch/rail_space_#rw#.csv

# text spotting one inch
worked_examples/geospatial/text_spotting_one_inch_maps/*/*
!worked_examples/geospatial/text_spotting_one_inch_maps/*/*/Pipeline.ipynb

# classification mnist
worked_examples/non-geospatial/classification_mnist/*
!worked_examples/non-geospatial/classification_mnist/Pipeline.ipynb
!worked_examples/non-geospatial/classification_mnist/annotations_mnist/mnist_#kasra#.csv
!worked_examples/non-geospatial/classification_mnist/small_mnist/

# classification plant phenotype
worked_examples/non-geospatial/classification_plant_phenotype/*
!worked_examples/non-geospatial/classification_plant_phenotype/Pipeline.ipynb
!worked_examples/non-geospatial/classification_plant_phenotype/annotations_plant_phenotype_open_acess/phenotype_test_#kasra#.csv
!worked_examples/non-geospatial/classification_plant_phenotype/dataset/

61 changes: 61 additions & 0 deletions .github/workflows/check_notebooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
name: Test notebooks

on:
push:
branches:
- dev
schedule:
- cron: 0 0 1 * *

# Run linter with github actions for quick feedbacks.
jobs:
all_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2

- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.11

- name: Update pip
run: |
python -m ensurepip
python -m pip install --upgrade pip
- name: Install dependencies
run: |
python -m pip install wheel
python -m pip install numpy==1.26.4 torch==2.2.2 torchvision==0.17.2 -f https://download.pytorch.org/whl/torch_stable.html
python -m pip install "mapreader[dev]"
python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
python -m pip install 'git+https://github.com/maps-as-data/DeepSolo.git'
python -m pip install 'git+https://github.com/maps-as-data/DPText-DETR.git'
python -m pip install 'git+https://github.com/maps-as-data/MapTextPipeline.git'
- name: Clone DPText-DETR
run: |
git clone https://github.com/maps-as-data/DPText-DETR.git
- name: Clone DeepSolo
run: |
git clone https://github.com/maps-as-data/DeepSolo.git
- name: Clone MapTextPipeline
run: |
git clone https://github.com/maps-as-data/MapTextPipeline.git
- name: Hugging Face CLI
run: |
pip install -U "huggingface_hub[cli]"
huggingface-cli download rwood-97/DPText_DETR_ArT_R_50_poly art_final.pth --local-dir .
huggingface-cli download rwood-97/DeepSolo_ic15_res50 ic15_res50_finetune_synth-tt-mlt-13-15-textocr.pth --local-dir .
huggingface-cli download rwood-97/MapTextPipeline_rumsey rumsey-finetune.pth --local-dir .
- name: Convert notebooks
run: |
find . -name "*.ipynb" -exec jupyter execute {} +
27 changes: 21 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
maps
test.ipynb
parent_df.csv
patch_df.csv
.maps
patches_*_pixel
# classification one inch
worked_examples/geospatial/*classification_one_inch_maps/*
!worked_examples/geospatial/*classification_one_inch_maps/Pipeline.ipynb
!worked_examples/geospatial/*classification_one_inch_maps/annotations_one_inch/rail_space_#rw#.csv

# text spotting one inch
worked_examples/geospatial/text_spotting_one_inch_maps/*/*
!worked_examples/geospatial/text_spotting_one_inch_maps/*/*/Pipeline.ipynb

# classification mnist
worked_examples/non-geospatial/classification_mnist/*
!worked_examples/non-geospatial/classification_mnist/Pipeline.ipynb
!worked_examples/non-geospatial/classification_mnist/annotations_mnist/mnist_#kasra#.csv
!worked_examples/non-geospatial/classification_mnist/small_mnist/

# classification plant phenotype
worked_examples/non-geospatial/classification_plant_phenotype/*
!worked_examples/non-geospatial/classification_plant_phenotype/Pipeline.ipynb
!worked_examples/non-geospatial/classification_plant_phenotype/annotations_plant_phenotype_open_acess/phenotype_test_#kasra#.csv
!worked_examples/non-geospatial/classification_plant_phenotype/dataset/

20 changes: 15 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use an official Python runtime as a parent image
FROM python:3.9
FROM python:3.11

RUN apt-get update

Expand All @@ -12,10 +12,20 @@ WORKDIR /app
COPY . /app

# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Download all maps for example notebooks
RUN python download-examples.py
RUN python -m pip install --upgrade pip
RUN python -m pip install numpy==1.26.4 torch==2.2.2 torchvision==0.17.2 -f https://download.pytorch.org/whl/torch_stable.html
RUN python -m pip install --no-cache-dir -r requirements.txt

# Clone text spotting repos
RUN git clone https://github.com/maps-as-data/DPText-DETR.git
RUN git clone https://github.com/maps-as-data/DeepSolo.git
RUN git clone https://github.com/maps-as-data/MapTextPipeline.git

# Get text spotting model weights
RUN python -m pip install -U "huggingface_hub[cli]"
RUN huggingface-cli download rwood-97/DPText_DETR_ArT_R_50_poly art_final.pth --local-dir .
RUN huggingface-cli download rwood-97/DeepSolo_ic15_res50 ic15_res50_finetune_synth-tt-mlt-13-15-textocr.pth --local-dir .
RUN huggingface-cli download rwood-97/MapTextPipeline_rumsey rumsey-finetune.pth --local-dir .

# Make port 8888 available to the world outside this container
EXPOSE 8888
Expand Down
Loading

0 comments on commit c154d0d

Please sign in to comment.