Browse Source

Generate database script updated

jbuisine 2 years ago
parent
commit
394af0dcca
2 changed files with 10 additions and 5 deletions
  1. 7 3
      README.md
  2. 3 2
      generate_dataset.py

+ 7 - 3
README.md

@@ -14,18 +14,22 @@ python generate_dataset.py
 ```
 
 It will split scenes and generate all data you need for your neural network.
-You can specify the number of sub images you want in the script by modifying **_NUMBER_SUB_IMAGES_** variables.
+You can specify the number of sub images you want in the script by modifying **_NUMBER_SUB_IMAGES_** variable or using parameter.
+
+```
+python generate_dataset.py --nb xxxx
+```
 
 There are 3 kinds of Neural Networks :
 - **classification_cnn_keras.py** : *based on cropped images and do convolution*
 - **classification_cnn_keras_cross_validation.py** : *based on cropped images and do convolution. Data are randomly split for training*
 - **classification_cnn_keras_svd.py** : *based on svd metrics of image*
 
-Note that the image input size need to change in you used specific size for your croped images.
 
 After your built your neural network in classification_cnn_keras.py, you just have to run it :
+
 ```
-classification_cnn_keras_svd.py --directory xxxx --output xxxxx --batch_size xx --epochs xx --img xx (or --image_width xx --img_height xx)
+python classification_cnn_keras_svd.py --directory xxxx --output xxxxx --batch_size xx --epochs xx --img xx (or --image_width xx --img_height xx)
 ```
 
 A config file in json is available and keeps in memory all image sizes available.

+ 3 - 2
generate_dataset.py

@@ -55,12 +55,13 @@ def main():
         print('generate_dataset.py --nb xxxx')
         sys.exit(2)
     try:
-        opts, args = getopt.getopt(sys.argv[1:], "hn", ["help", "nb="])
+        opts, args = getopt.getopt(sys.argv[1:], "h:n", ["help", "nb="])
     except getopt.GetoptError:
         # print help information and exit:
         print('generate_dataset.py --nb xxxx')
         sys.exit(2)
     for o, a in opts:
+
         if o == "-h":
             print('generate_dataset.py --nb xxxx')
             print('20x20 : 1600')
@@ -69,7 +70,7 @@ def main():
             print('80x80 : 100')
             print('100x100 : 64')
             sys.exit()
-        elif o == '-n':
+        elif o == '--nb':
             NUMBER_SUB_IMAGES = int(a)
 
     init_directory()