Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Bender97 committed Sep 30, 2024
0 parents commit 9f5a385
Show file tree
Hide file tree
Showing 40 changed files with 7,466 additions and 0 deletions.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Horticultural Temporal Fruit Monitoring via 3D Instance Segmentation and Re-Identification using Point Clouds

```
python3.8 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
```

### Install MinkowskiEngine

If you don't have it, it's better to install ninja to compile MinkowskiEngine
```
pip install ninja
```

```
git clone https://github.com/NVIDIA/MinkowskiEngine.git
cd MinkowskiEngine
python setup.py install
```

## Instance Segmentation
```
export PYTHONPATH=$(realpath instance_segmentation)
cd instance_segmentation/mink_pan
python scripts/run_full_row.py --modelpath {PATH_TO_MODEL}
```

## Re-Identification
```
cd re_identification
python3 associate.py --data {PATH_TO_DATA_FOLDER} --iou 0.05
python3 extractor.py --data {PATH_TO_DATA_FOLDER} --iou 0.05
python3 train.py --data {PATH_TO_DATA_FOLDER} --iou 0.05 --mode testinst
```


## Visualize Results
```
visualize entire test set in 2D
python3 visualize_clouds.py --data {PATH_TO_DATA_FOLDER} --iou 0.05
visualize entire test set in 2D
python3 visualize_clouds3D.py --data {PATH_TO_DATA_FOLDER} --iou 0.05
```
6 changes: 6 additions & 0 deletions instance_segmentation/mink_pan/config/backbone.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
BACKBONE:
DIMENSION: 3
INPUT_DIM: 6 # coords + rgb
CR: 1 # channel ratio, change feature dimensions
CHANNELS: [32, 32, 64, 128, 256, 256, 128, 96, 96]
RESOLUTION: 0.0005
62 changes: 62 additions & 0 deletions instance_segmentation/mink_pan/config/model.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
EXPERIMENT:
ID: mink_panoptic

TRAIN:
LR: 0.02
MAX_EPOCH: 100
BATCH_SIZE: 2
BATCH_ACC: 4
NUM_WORKERS: 6
N_GPUS: -1
FREEZE_MODULES: []
#FREEZE_MODULES: ['BACKBONE','SEM_HEAD','INS_HEAD']
AUG: True
SUBSAMPLE: True

MODEL:
DATASET: STRAWBERRIES

POST:
ALG: MEANSHIFT #HDBSCAN, MEANSHIFT
BANDWIDTH: 0.01 #Meanshift
MIN_CLUSTER: 5 #hdbscan #10 for nuscenes

LOSS:
SEM:
WEIGHTS: [2,6] #Ce, Lovasz

STRAWBERRIES:
PATH: /home/fusy/Documents/strawberries/DeployStrawberries/data #data/kitti
CONFIG: datasets/strawberries.yaml
NUM_CLASSES: 2 #Get from yaml
IGNORE_LABEL: -1
SPACE: # coord limits
[[-48.0,48.0],[-48.0,48.0],[-4.0,1.5]]
MIN_VOLUME_SPACE: [3,'-pi',-3]
MAX_VOLUME_SPACE: [50,'pi',1.5]
MINI: False
SUB_NUM_POINTS: 400000

KITTI:
PATH: data/kitti
CONFIG: datasets/semantic-kitti.yaml
NUM_CLASSES: 20 #Get from yaml
IGNORE_LABEL: 0
SPACE: # coord limits
[[-48.0,48.0],[-48.0,48.0],[-4.0,1.5]]
MIN_VOLUME_SPACE: [3,'-pi',-3]
MAX_VOLUME_SPACE: [50,'pi',1.5]
MINI: False
SUB_NUM_POINTS: 80000

NUSCENES:
PATH: data/nuscenes
CONFIG: datasets/semantic-nuscenes.yaml
NUM_CLASSES: 17 #Get from yaml
IGNORE_LABEL: 0
SPACE: # coord limits
[[-50.0,50.0],[-50.0,50.0],[-5.0,3]]
MIN_VOLUME_SPACE: [0,'-pi',-5]
MAX_VOLUME_SPACE: [50,'pi',3]
MINI: False
SUB_NUM_POINTS: 50000
Loading

0 comments on commit 9f5a385

Please sign in to comment.