Parcourir la source

Merge branch 'release/v0.2.7'

Jérôme BUISINE il y a 4 ans
Parent
commit
c516647dd5
5 fichiers modifiés avec 105 ajouts et 3 suppressions
  1. 14 0
      README.md
  2. 3 3
      classes/Transformation.py
  3. 34 0
      oar/README.md
  4. 39 0
      oar/generate_symlinks.sh
  5. 15 0
      oar/oar.example.sh

+ 14 - 0
README.md

@@ -23,6 +23,20 @@ There is few configuration files (`config` folder):
 git submodule add https://github.com/prise-3d/Thesis-CommonModules.git modules
 ```
 
+## Dataset information
+
+| ID | Name | Renderer | Number of Images |
+|:---:|---:|---:|---:|
+| A | Appart1opt02 | maxwell | 89 |
+| B | Bureau1 | igloo | 200 |
+| C | Cendrier | | 25 |
+| D | Cuisine01 | maxwell | 116 |
+| E | EchecsBas | cycle| 200 |
+| F | PNDVuePlongeante | igloo | 800 |
+| G | SdbCentre | maxwell | 94 |
+| H | SdbDroite | maxwell | 94 |
+| I | Selles | cycle | 62 |
+
 ## License
 
 [The MIT License](LICENSE)

+ 3 - 3
classes/Transformation.py

@@ -24,20 +24,20 @@ class Transformation():
         if self.transformation == 'svd_reconstruction':
             begin, end = list(map(int, self.param.split(',')))
             h, w = list(map(int, self.size.split(',')))
-            img.thumbnail((h, w))
             data = reconstruction.svd(img, [begin, end])
+            data = np.array(Image.fromarray(data).thumbnail((h, w)))
 
         if self.transformation == 'ipca_reconstruction':
             n_components, batch_size = list(map(int, self.param.split(',')))
             h, w = list(map(int, self.size.split(',')))
-            img.thumbnail((h, w))
             data = reconstruction.ipca(img, n_components, batch_size)
+            data = np.array(Image.fromarray(data).thumbnail((h, w)))
 
         if self.transformation == 'fast_ica_reconstruction':
             n_components = self.param
             h, w = list(map(int, self.size.split(',')))
-            img.thumbnail((h, w))
             data = reconstruction.fast_ica(img, n_components)
+            data = np.array(Image.fromarray(data).thumbnail((h, w)))
 
         if self.transformation == 'min_diff_filter':
             w_size, h_size = list(map(int, self.param.split(',')))

+ 34 - 0
oar/README.md

@@ -0,0 +1,34 @@
+# Run on Calculco
+
+## Preparation of project
+
+```
+cd ~/projects
+git clone https://%PROJET_NAME%.git %PROJET_NAME%
+```
+
+Push you `dataset` into the /scratch/orvalXX/lisic/user/data
+```
+cp -r %PROJET_NAME% /scratch/orvalXX/lisic/user/%PROJET_NAME%
+```
+
+## Link data
+
+Create symbolic links to `dataset` of project:
+```
+ln -s /scracth/orvalXX/lisic/user/data/%PROJET_NAME% dataset
+```
+
+Create all usefull symbolic links to for project:
+```
+bash modules/oar/generate_symlinks orvalXX lisic/user/projects/%PROJET_NAME%
+```
+
+**Note:** `modules` is the submodule name of this project into your own project.
+
+## Run script
+
+Create your `oar.sh` script based on `oar.example.sh` and run it:
+```
+oarsub -S oar.sh
+```

+ 39 - 0
oar/generate_symlinks.sh

@@ -0,0 +1,39 @@
+#! /bin/bash
+
+if [ -z "$1" ]
+  then
+    echo "No argument supplied"
+    echo "Need to specify orval you want to use (in /scratch folder)"
+    exit 1
+fi
+
+if [ -z "$2" ]
+  then
+    echo "No argument supplied"
+    echo "Need to specify where you want to store data"
+    exit 1
+fi
+
+
+echo "Creating links into /scratch folder"
+
+scratch="/scratch"
+orval=$1
+path=$2
+
+
+for link in {"data","results","logs","saved_models","models_info","models_backup","threshold_map","learned_zones","custom_norm"}; do
+    
+    if [ -L ${link} ]; then
+        rm ${link}
+    fi
+    
+    fullpath=${scratch}/${orval}/${path}/${link}
+
+    if [ ! -d "${fullpath}" ]; then
+        mkdir -p ${fullpath}
+    fi
+    
+    # remove `orval` name for running part
+    ln -s ${scratch}/${path}/${link} ${link}
+done

+ 15 - 0
oar/oar.example.sh

@@ -0,0 +1,15 @@
+#!/bin/sh
+
+#OAR --array-param-file params.txt
+#OAR -l /nodes=1,walltime=6:00:00
+#OAR -p host="orval02"
+#OAR -t besteffort
+#OAR --notify mail:jerome.buisine@univ-littoral.fr
+#OAR -O /nfs/home/lisic/jbuisine/projects/launchers/logs/Thesis-NoiseDetection-CNN.%jobid%.out
+#OAR -E /nfs/home/lisic/jbuisine/projects/launchers/logs/Thesis-NoiseDetection-CNN.%jobid%.err
+
+# Activiate venv used by python
+. ~/opt/venvs/thesis-venv/bin/activate
+
+# run command
+python ~/projects/Thesis-NoiseDetection-CNN/generate/generate_reconstructed_data.py $@