Skip to content
Permalink
Browse files

Initial Commit

  • Loading branch information...
alexlopezcifuentes committed Sep 9, 2019
1 parent 7fa77fd commit bc44b7f955dcd3bdb008e0be8dd8379f5c788f51
Showing with 96,100 additions and 3 deletions.
  1. +24 −0 .gitignore
  2. +120 −0 Config/Conda_Env.yml
  3. +41 −0 Config/config_ADE20K.yaml
  4. +41 −0 Config/config_MITIndoor.yaml
  5. +41 −0 Config/config_Places365.yaml
  6. +41 −0 Config/config_SUN397.yaml
  7. +61 −0 Data/Datasets/ADEChallengeData2016/README.md
  8. +1,055 −0 Data/Datasets/ADEChallengeData2016/Scene_Names.txt
  9. +151 −0 Data/Datasets/ADEChallengeData2016/objectInfo150.txt
  10. +22,210 −0 Data/Datasets/ADEChallengeData2016/sceneCategories.txt
  11. +20,210 −0 Data/Datasets/ADEChallengeData2016/sceneCategories_training.txt
  12. +2,000 −0 Data/Datasets/ADEChallengeData2016/sceneCategories_validation.txt
  13. +84 −0 Data/Datasets/MITIndoor67/README.md
  14. +67 −0 Data/Datasets/MITIndoor67/scene_names.txt
  15. +5,360 −0 Data/Datasets/MITIndoor67/train.txt
  16. +1,340 −0 Data/Datasets/MITIndoor67/val.txt
  17. +84 −0 Data/Datasets/SUN397/README.md
  18. +397 −0 Data/Datasets/SUN397/scene_names.txt
  19. +19,850 −0 Data/Datasets/SUN397/train.txt
  20. +19,850 −0 Data/Datasets/SUN397/val.txt
  21. +84 −0 Data/Datasets/places365_standard/README.md
  22. 0 Data/Model Zoo/.gitkeep
  23. 0 Data/Model Zoo/ADEChallengeData2016/.gitkeep
  24. 0 Data/Model Zoo/MITIndoor67/.gitkeep
  25. 0 Data/Model Zoo/SUN397/.gitkeep
  26. 0 Data/Model Zoo/places365_standard/.gitkeep
  27. BIN Docs/ExampleFocus.png
  28. BIN Docs/LogoMinisterio.png
  29. BIN Docs/NetworkArchitecture.png
  30. +298 −0 Libs/Datasets/ADE20KDataset.py
  31. +296 −0 Libs/Datasets/MITIndoor67Dataset.py
  32. +313 −0 Libs/Datasets/Places365Dataset.py
  33. +296 −0 Libs/Datasets/SUN397Dataset.py
  34. +86 −0 Libs/Utils/dfw/bpgrad.py
  35. +103 −0 Libs/Utils/dfw/dfw.py
  36. +123 −0 Libs/Utils/torchsummary/torchsummary.py
  37. +465 −0 Libs/Utils/utils.py
  38. +149 −3 README.md
  39. +76 −0 RGBBranch.py
  40. +183 −0 SASceneNet.py
  41. +18 −0 Scripts/download_ADE20K.sh
  42. +13 −0 Scripts/download_ADE20K_extra.sh
  43. +14 −0 Scripts/download_MITIndoor67.sh
  44. +13 −0 Scripts/download_MITIndoor67_extra.sh
  45. +65 −0 Scripts/download_ModelZoo.sh
  46. +14 −0 Scripts/download_Places365.sh
  47. +14 −0 Scripts/download_Places365_extra.sh
  48. +14 −0 Scripts/download_SUN397.sh
  49. +13 −0 Scripts/download_SUN397_extra.sh
  50. +104 −0 SemBranch.py
  51. +319 −0 evaluation.py
@@ -0,0 +1,24 @@

Data/Datasets/ADEChallengeData2016/images/

Data/Datasets/ADEChallengeData2016/annotations/

Data/Datasets/ADEChallengeData2016/noisy_annotations_RGB/

Data/Datasets/ADEChallengeData2016/noisy_scores_RGB/

Data/Datasets/MITIndoor67/noisy_annotations_RGB/

Data/Datasets/MITIndoor67/noisy_scores_RGB/

Data/Datasets/MITIndoor67/train/

Data/Datasets/MITIndoor67/val/

Results/

__pycache__/

\.idea/

*.tar
@@ -0,0 +1,120 @@
name: SA-Scene-Recognition
channels:
- conda-forge
- defaults
dependencies:
- _libgcc_mutex=0.1=main
- blas=1.0=mkl
- bzip2=1.0.6=h14c3975_1002
- ca-certificates=2019.6.16=hecc5488_0
- cairo=1.16.0=h18b612c_1001
- certifi=2019.6.16=py37_0
- cffi=1.12.3=py37h8022711_0
- cloudpickle=1.2.1=py_0
- cudatoolkit=10.0.130=0
- cudnn=7.6.0=cuda10.0_0
- cycler=0.10.0=py_1
- cytoolz=0.9.0.1=py37h14c3975_1001
- dask-core=2.1.0=py_0
- dbus=1.13.6=he372182_0
- decorator=4.4.0=py_0
- expat=2.2.5=he1b5a44_1003
- ffmpeg=4.1.3=h167e202_0
- fontconfig=2.13.1=he4413a7_1000
- freetype=2.10.0=he983fc9_0
- geos=3.7.2=he1b5a44_1
- gettext=0.19.8.1=hc5be6a0_1002
- giflib=5.1.9=h516909a_0
- glib=2.58.3=h6f030ca_1001
- gmp=6.1.2=hf484d3e_1000
- gnutls=3.6.5=hd3a4fd2_1002
- graphite2=1.3.13=hf484d3e_1000
- gst-plugins-base=1.14.5=h0935bb2_0
- gstreamer=1.14.5=h36ae1b5_0
- harfbuzz=2.4.0=h37c48d4_1
- hdf5=1.10.5=nompi_h3c11f04_1100
- icu=58.2=hf484d3e_1000
- imageio=2.5.0=py37_0
- imgaug=0.2.9=py_1
- intel-openmp=2019.4=243
- jasper=1.900.1=h07fcdf6_1006
- jpeg=9c=h14c3975_1001
- kiwisolver=1.1.0=py37hc9558a2_0
- lame=3.100=h14c3975_1001
- libblas=3.8.0=10_mkl
- libcblas=3.8.0=10_mkl
- libffi=3.2.1=he1b5a44_1006
- libgcc-ng=9.1.0=hdf63c60_0
- libgfortran-ng=7.3.0=hdf63c60_0
- libiconv=1.15=h516909a_1005
- liblapack=3.8.0=10_mkl
- liblapacke=3.8.0=10_mkl
- libpng=1.6.37=hed695b0_0
- libstdcxx-ng=9.1.0=hdf63c60_0
- libtiff=4.0.10=h57b8799_1003
- libuuid=2.32.1=h14c3975_1000
- libwebp=1.0.2=h576950b_1
- libxcb=1.13=h14c3975_1002
- libxml2=2.9.9=h13577e0_1
- lz4-c=1.8.3=he1b5a44_1001
- matplotlib=3.1.1=py37_0
- matplotlib-base=3.1.1=py37hfd891ef_0
- mkl=2019.4=243
- mkl_fft=1.0.13=py37h516909a_1
- mkl_random=1.0.4=py37hf2d7682_0
- ncurses=6.1=hf484d3e_1002
- nettle=3.4.1=h1bed415_1002
- networkx=2.3=py_0
- ninja=1.9.0=h6bb024c_0
- numpy=1.16.4=py37h7e9f1db_0
- numpy-base=1.16.4=py37hde5b4d6_0
- olefile=0.46=py_0
- opencv=4.1.0=py37h3aa1047_5
- openh264=1.8.0=hdbcaa40_1000
- openssl=1.1.1c=h516909a_0
- pcre=8.41=hf484d3e_1003
- pillow=6.1.0=py37he7afcd5_0
- pip=19.1.1=py37_0
- pixman=0.38.0=h516909a_1003
- pthread-stubs=0.4=h14c3975_1001
- pycparser=2.19=py37_1
- pyparsing=2.4.0=py_0
- pyqt=5.9.2=py37hcca6a23_0
- python=3.7.3=h33d41f4_1
- python-dateutil=2.8.0=py_0
- pytorch=1.0.1=cuda100py37he554f03_0
- pywavelets=1.0.3=py37hd352d35_1
- pyyaml=5.1.1=py37h516909a_0
- qt=5.9.7=h52cfd70_2
- readline=8.0=hf8c457e_0
- scikit-image=0.15.0=py37hb3f55d8_2
- scipy=1.3.0=py37h921218d_0
- setuptools=41.0.1=py37_0
- shapely=1.6.4=py37hec07ddf_1006
- sip=4.19.8=py37hf484d3e_1000
- six=1.12.0=py37_1000
- sqlite=3.29.0=hcee41ef_0
- tk=8.6.9=hed695b0_1002
- toolz=0.9.0=py_1
- torchvision=0.2.1=py37_1000
- tornado=6.0.3=py37h516909a_0
- wheel=0.33.4=py37_0
- x264=1!152.20180806=h14c3975_0
- xorg-kbproto=1.0.7=h14c3975_1002
- xorg-libice=1.0.9=h516909a_1004
- xorg-libsm=1.2.3=h84519dc_1000
- xorg-libx11=1.6.7=h14c3975_1000
- xorg-libxau=1.0.9=h14c3975_0
- xorg-libxdmcp=1.1.3=h516909a_0
- xorg-libxext=1.3.4=h516909a_0
- xorg-libxrender=0.9.10=h516909a_1002
- xorg-renderproto=0.11.1=h14c3975_1002
- xorg-xextproto=7.3.0=h14c3975_1002
- xorg-xproto=7.0.31=h14c3975_1007
- xz=5.2.4=h14c3975_1001
- yaml=0.1.7=h14c3975_1001
- zlib=1.2.11=h14c3975_1004
- zstd=1.4.0=h3b9ef0a_0
- pip:
- addict==2.2.1

@@ -0,0 +1,41 @@
EXP:
ID: ADE20K
OUTPUT_DIR: Results

DATASET:
NAME: ADEChallengeData2016
ROOT: /home/vpu/Semantic-Aware-Scene-Recognition/Data/Datasets
SCENE_LABELS: ./Data/Datasets/ADEChallengeData2016/sceneCategories.txt
SEM_LABELS: ./Data/Datasets/ADEChallengeData2016/objectInfo150.txt
N_CLASSES_SCENE: 1055
N_CLASSES_SEM: 151

DATALOADER:
NUM_WORKERS: 8

MODEL:
PATH: ./Data/Model Zoo/ADEChallengeData2016/
NAME: SAScene_ResNet18_ADE
ONLY_RGB: FALSE
ONLY_SEM: FALSE

TRAINING:
PRINT_FREQ: 10
PRECOMPUTED_SEM: TRUE
BATCH_SIZE:
TRAIN: 100
TEST: 100
LR: 2.5e-4
LR_DECAY: 10
MOMENTUM: 0.9
OPTIMIZER: DFW
POLY_POWER: 0.9
WEIGHT_DECAY: 5.0e-4
AVERAGE_LOSS: 20

VALIDATION:
PRINT_FREQ: 10
BATCH_SIZE:
TRAIN: 100
TEST: 10
TEN_CROPS: TRUE
@@ -0,0 +1,41 @@
EXP:
ID: MITIndoor67
OUTPUT_DIR: Results

DATASET:
NAME: MITIndoor67
ROOT: /home/vpu/Semantic-Aware-Scene-Recognition/Data/Datasets
SCENE_LABELS: ./Data/Datasets/MITIndoor67/scene_names.txt
SEM_LABELS: ./Data/Datasets/ADEChallengeData2016/objectInfo150.txt
N_CLASSES_SCENE: 67
N_CLASSES_SEM: 151

DATALOADER:
NUM_WORKERS: 8

MODEL:
PATH: ./Data/Model Zoo/MITIndoor67/
NAME: SAScene_ResNet18_MIT
ONLY_RGB: FALSE
ONLY_SEM: FALSE

TRAINING:
PRINT_FREQ: 10
PRECOMPUTED_SEM: TRUE
BATCH_SIZE:
TRAIN: 100
TEST: 100
LR: 2.5e-4
LR_DECAY: 10
MOMENTUM: 0.9
OPTIMIZER: DFW
POLY_POWER: 0.9
WEIGHT_DECAY: 5.0e-4
AVERAGE_LOSS: 20

VALIDATION:
PRINT_FREQ: 10
BATCH_SIZE:
TRAIN: 100
TEST: 10
TEN_CROPS: TRUE
@@ -0,0 +1,41 @@
EXP:
ID: places365_standard
OUTPUT_DIR: Results

DATASET:
NAME: places365_standard
ROOT: /home/vpu/Semantic-Aware-Scene-Recognition/Data/Datasets
SCENE_LABELS: ./Data/Datasets/places365_standard/scene_names.txt
SEM_LABELS: ./Data/Datasets/ADEChallengeData2016/objectInfo150.txt
N_CLASSES_SCENE: 365
N_CLASSES_SEM: 151

DATALOADER:
NUM_WORKERS: 8

MODEL:
PATH: ./Data/Model Zoo/places365_standard/
NAME: SAScene_ResNet18_Places
ONLY_RGB: FALSE
ONLY_SEM: FALSE

TRAINING:
PRINT_FREQ: 10
PRECOMPUTED_SEM: TRUE
BATCH_SIZE:
TRAIN: 100
TEST: 100
LR: 2.5e-4
LR_DECAY: 10
MOMENTUM: 0.9
OPTIMIZER: DFW
POLY_POWER: 0.9
WEIGHT_DECAY: 5.0e-4
AVERAGE_LOSS: 20

VALIDATION:
PRINT_FREQ: 10
BATCH_SIZE:
TRAIN: 100
TEST: 10
TEN_CROPS: TRUE
@@ -0,0 +1,41 @@
EXP:
ID: SUN397
OUTPUT_DIR: Results

DATASET:
NAME: SUN397
ROOT: /home/vpu/Semantic-Aware-Scene-Recognition/Data/Datasets
SCENE_LABELS: ./Data/Datasets/SUN397/scene_names.txt
SEM_LABELS: ./Data/Datasets/ADEChallengeData2016/objectInfo150.txt
N_CLASSES_SCENE: 397
N_CLASSES_SEM: 151

DATALOADER:
NUM_WORKERS: 8

MODEL:
PATH: ./Data/Model Zoo/SUN397/
NAME: SAScene_ResNet18_SUN
ONLY_RGB: FALSE
ONLY_SEM: FALSE

TRAINING:
PRINT_FREQ: 10
PRECOMPUTED_SEM: TRUE
BATCH_SIZE:
TRAIN: 100
TEST: 100
LR: 2.5e-4
LR_DECAY: 10
MOMENTUM: 0.9
OPTIMIZER: DFW
POLY_POWER: 0.9
WEIGHT_DECAY: 5.0e-4
AVERAGE_LOSS: 20

VALIDATION:
PRINT_FREQ: 10
BATCH_SIZE:
TRAIN: 100
TEST: 10
TEN_CROPS: TRUE
@@ -0,0 +1,61 @@
# ADE20K Dataset Setup
Instructions to download and setup [ADE20K Dataset](https://groups.csail.mit.edu/vision/datasets/ADE20K/).

## Setup
### RGB Images

1. To download ADE20K training and validation sets (RGB Images) run the following script (~1GB) from the repository folder:

bash ./Scripts/download_ADE20K.sh [PATH]

For example:

bash ./Scripts/download_ADE20K.sh ./Data/Datasets/ADEChallengeData2016

2. Copy the [PATH] to the `config_ADE20K.yaml` configuration file:

DATASET:
NAME: ADEChallengeData2016
ROOT: [WRITE PATH HERE]

### [RECOMMENDED] Precomputed Semantic Segmentation Information

1. To download precomputed Semantic Segmentation maks for faster training and validation (labels and scores) run the following script (~3GB) from the repository folder:

bash ./Scripts/download_ADE20K_extra.sh [PATH FOR DATASET]

For example

bash ./Scripts/download_ADE20K_extra.sh ./Data/Datasets/ADEChallengeData2016

2. To use precomputed semantic segmentation activate the option `PRECOMPUTED_SEM` in `config_ADE20K.yaml` configuration file:

PRECOMPUTED_SEM: TRUE

## Dataset Structure
The dataset must follow the following structure:
```
|----images
|--- training
ADE_train_00000001.jpg
...
|--- validation
ADE_val_00000001.jpg
...
|----noisy_annotations_RGB
|--- training
ADE_train_00000001.png
...
|--- validation
ADE_train_00000001.png
...
|----noisy_scores_RGB
|--- training
ADE_train_00000001.png
...
|--- validation
ADE_train_00000001.png
...
```

Note that *noisy_annotations* and *noisy_scores* folders are only necessary if precomputed semantic segmentation is used.

0 comments on commit bc44b7f

Please sign in to comment.
You can’t perform that action at this time.