Skip to content

Commit

Permalink
changed requirements.txt for environment.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
zeppehpt1 committed Feb 7, 2024
1 parent 8c2a3af commit ea30a3d
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 67 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# treeclust

<p>
<a href="https://github.com/zeppehpt1/treeclust/blob/main/LICENSE"><img alt="License: MIT" src="https://black.readthedocs.io/en/stable/_static/license.svg"></a>
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
</p>

Python package for automatic processing and clustering of tree species using several different image preprocessing, dimensionality reduction and clustering techniques. The current implementation works with annotated data to take advantage of tree species clustering capabilities based on high-resolution RGB image data. However, with some adjustments, the code can also be used to cluster tree species when tree species labels are not available.

The data used for training the tree detection and delineation model, as well as the data used for the analysis pipeline, can be made available upon request. Please do not hesitate to contact me if you have any questions about the data or individual parts of the process.
Expand Down
13 changes: 5 additions & 8 deletions docker/dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ FROM python:3.8

WORKDIR /treeclust

# add req.txt
COPY requirements.txt .
# Add dependencies and channel information
COPY environment.yaml .

# Install base utilities for conda and opencv
RUN apt-get update \
Expand All @@ -23,13 +23,10 @@ RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86
ENV PATH=$CONDA_DIR/bin:$PATH

RUN conda config --add channels conda-forge \
&& conda config --add channels pytorch \
&& conda install mamba pip \
&& pip install fuzzy-c-means \
&& ls \
&& mamba install --file requirements.txt
&& conda install mamba \
&& mamba env create -f environment.yaml

# Add files
COPY . .

CMD ["python", "treeclust/__main__.py"]
CMD ["conda", "run", "-n", "treeclust", "python", "treeclust/__main__.py"]
36 changes: 36 additions & 0 deletions environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: treeclust
channels:
- conda-forge
- pytorch
- nvidia
dependencies:
- python=3.8
- pip
- fiona
- geocube
- geopandas
- joblib
- libjpeg-turbo
- libpng
- matplotlib
- numpy
- opencv # conda opencv
- pandas
- pillow
- pyarrow
- pytest
- python-dotenv
- rasterio
- rioxarray
- scikit-learn # conda scikit-learn
- scipy
- seaborn
- shapely
- scikit-image
- pytorch=2.1.2 # conda pytorch==2.1.2
- torchvision=0.16.2
- tqdm
- umap-learn # conda umap-learn
- yellowbrick
- pip:
- fuzzy-c-means
25 changes: 0 additions & 25 deletions requirements.txt

This file was deleted.

33 changes: 0 additions & 33 deletions setup.py

This file was deleted.

3 changes: 2 additions & 1 deletion treeclust/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import pandas as pd
import umap as up
import pickle
import warnings
warnings.filterwarnings("ignore", message="n_jobs value -1 overridden to 1 by setting random_state. Use no seed for parallelism.")

from typing import Tuple
from numpy.typing import NDArray
Expand Down Expand Up @@ -32,7 +34,6 @@
import label_tools as lt
from constants import NUMBER_OF_CLASSES


def load_features(features_path: str) -> Tuple[list, NDArray, list]:
with open(features_path, "rb") as f:
data = pickle.load(f)
Expand Down

0 comments on commit ea30a3d

Please sign in to comment.