Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Udayraj123 committed Dec 7, 2019
1 parent 117fe7e commit a923a14
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 27 deletions.
51 changes: 26 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,48 +122,49 @@ python3 -m pip install --user -r requirements.txt
<!-- Wiki should not get cloned -->
### 3. Run the code

#### A. Running default sample
If you want to try out the default sample, you can directly run:
```bash
python3 main.py
```
#### B. Running other samples

1. Put your data in inputs folder. You can copy sample data as shown below:
<!-- mkdir inputs/ -->
```bash
# Note: remove previous inputs if any with `mv inputs/* ~/.trash`
# sample1 is the default sample
cp -r ./samples/sample2/* inputs/
# Note: you may remove previous inputs if any with `mv inputs/* ~/.trash`
cp -r ./samples/sample1 inputs/
```
_Note: Change the number N in sampleN to see more examples_
2. Run OMRChecker:
**` python3 main.py --noMarkers `**
See usage guide [here](https://github.com/Udayraj123/OMRChecker/wiki/User-Guide#Run-the-code).
**` python3 main.py `**

<!-- 4. [Profit](https://knowyourmeme.com/memes/profit)!! -->
_**Note:** For subsequent runs, if you don't want the outputs to append to previous results file: Make sure the outputs folder is clean too : `rm -rf outputs/`._
These samples demonstrate different ways OMRChecker can be used.

<!-- ### Folder Structure
<img align="center" src="https://raw.githubusercontent.com/Udayraj123/OMRChecker/master/directory_structure.png" alt="Directory Structure" height="350">
#### Running it on your own OMR Sheets

This structure has been created to suit for better organization of OMRs (Citywise then Group-wise and Language-wise). Making changes to this would require changes in the code.
-->
#### C. Running it on your own OMR Sheets
<!-- Template alignment image here -->
1. Follow the [User Guide](https://github.com/Udayraj123/OMRChecker/wiki/User-Guide/) to create your own Template Layout.
2. Open `globals.py` and play with the parameters (although most of them would need no change :smile:)
3. Run the code with [appropriate arguments](https://github.com/Udayraj123/OMRChecker/wiki/User-Guide#Run-the-code).
1. First create your own template.json. You may modify json from one of the samples with help from `--setLayout` option (See usage below)
2. Open `globals.py` and play with the tuning parameters (although most of them would need no change :smile:)
<!-- 3. Add answer key( TODO: add answer key/marking scheme guide) -->

##### Full Usage
```
python3 main.py [--setLayout] [--noCropping] [--autoAlign] [--inputDir dir1] [--outputDir dir1] [--template path/to/template.json]
```

Explanation for the arguments:

`--setLayout`: To setup template layout interactively(for custom OMRs). See Walkthrough here.

`--autoAlign`: Enables automatic template alignment(experimental) - use only when the paper was bent slightly when scanning.

`--noCropping`: Disables page contour detection - used for images from a document scanner where page boundary is not visible.

`--inputDir`: Specify an input directory.

`--outputDir`: Specify an output directory.

`--template`: Specify a default template if no template file in input directories.

<!-- #### Testing the code
Datasets to test on :
Low Quality Dataset(For CV Based methods)) (1.5 GB)
Standard Quality Dataset(For ML Based methods) (3 GB)
High Quality Dataset(For custom processing) (6 GB)
-->


## 💡 Why is this software free?

The idea for this project began at Technothlon, which is a non-profit international school championship. After seeing it work fabulously at such a large scale, we decided to share this simple and powerful tool with the world to perhaps help revamp OMR checking processes and help greatly reduce the tediousness of the work involved.
Expand Down
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,9 @@ def evaluate_correctness(template, out):
# https://docs.python.org/3/howto/argparse.html
# store_true: if the option is specified, assign the value True to args.verbose. Not specifying it implies False.
argparser.add_argument("-c", "--noCropping", required=False, dest='noCropping', action='store_true',
help="Disable page contour detection - use only when page boundary is visible, e.g. images from mobile camera.")
help="Disables page contour detection - used for images from a document scanner where page boundary is not visible.")
argparser.add_argument("-a", "--autoAlign", required=False, dest='autoAlign', action='store_true',
help="Enable automatic template alignment - use only when the paper was bent slightly when scanning.")
help="Enables automatic template alignment - use only when the paper was bent slightly when scanning.")
argparser.add_argument("-l", "--setLayout", required=False, dest='setLayout', action='store_true',
help="Set up OMR template layout - modify your json file and run again until the template is set.")
argparser.add_argument("-i", "--inputDir", required=False, action='append',
Expand Down

0 comments on commit a923a14

Please sign in to comment.