Skip to content

Commit

Permalink
Restore inputs folder, Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Udayraj123 committed Dec 7, 2019
1 parent a923a14 commit 6d55e9c
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 45 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# outputs/Results
**/__pycache__
**/CheckedOMRs
**/convertedOMRs_LQ
**/gitignore
**/ignore
**/.DS_Store
OMRChecker.wiki/
Expand Down
72 changes: 32 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,18 @@ Images can be taken from various angles as shown below-
<img alt="sample_input" width="400" src="https://raw.githubusercontent.com/wiki/Udayraj123/OMRChecker/extras/Progress/2019-04-26/images/sample_input.PNG">
</p>

These images will be processed in the following manner:
### Code in action on images taken by scanner:
<p align="center">
<img alt="document_scanner" height="300" src="https://raw.githubusercontent.com/wiki/Udayraj123/OMRChecker/extras/mini_scripts/outputs/gif/document_scanner.gif">

</p>

### Code in action on images taken by a mobile phone:
<p align="center">
<img alt="checking_xeroxed_mobile" height="300" src="https://raw.githubusercontent.com/wiki/Udayraj123/OMRChecker/extras/mini_scripts/outputs/gif/checking_xeroxed_mobile.gif">
</p>

See step by step processing of any OMR sheet:
<p align="center">
<a href="https://github.com/Udayraj123/OMRChecker/wiki/Rich-Visuals">
<img alt="rotation_stack" width="650" src="https://raw.githubusercontent.com/wiki/Udayraj123/OMRChecker/extras/Progress/2019-04-26/images/rotation.PNG">
Expand All @@ -52,26 +63,15 @@ These images will be processed in the following manner:
*Note: This image is generated by the code itself!*
</p>

Finally a CSV file will also be generated containing all the responses and scoring
Output: A CSV sheet containing the detected responses and evaluated scores:

<p align="center">
<a href="https://github.com/Udayraj123/OMRChecker/wiki/Rich-Visuals">
<img alt="csv_output" width="550" src="https://raw.githubusercontent.com/wiki/Udayraj123/OMRChecker/extras/Progress/2019-04-26/images/csv_output.PNG">
</a>
</p>

### There are many visuals in the wiki. [Check them out!](https://github.com/Udayraj123/OMRChecker/wiki/Rich-Visuals)

### Code in action on images taken by scanner:
<p align="center">
<img alt="document_scanner" height="300" src="https://raw.githubusercontent.com/wiki/Udayraj123/OMRChecker/extras/mini_scripts/outputs/gif/document_scanner.gif">

</p>

### Code in action on images taken by a mobile phone:
<p align="center">
<img alt="checking_xeroxed_mobile" height="300" src="https://raw.githubusercontent.com/wiki/Udayraj123/OMRChecker/extras/mini_scripts/outputs/gif/checking_xeroxed_mobile.gif">
</p>
#### There are many visuals in the wiki. [Check them out!](https://github.com/Udayraj123/OMRChecker/wiki/Rich-Visuals)

## Getting started
![Setup Time](https://img.shields.io/badge/Setup_Time-20_min-blue.svg)
Expand Down Expand Up @@ -115,9 +115,7 @@ Note: Contributors should take a full clone(without the --depth flag).
cd OMRChecker/
python3 -m pip install --user -r requirements.txt
```
> **Note:** If you face a distutils error, use the `--ignore-installed` flag
> sudo python3 -m pip install --ignore-installed -r requirements.txt
> **Note:** If you face a distutils error, use `--ignore-installed` flag in above command.
<!-- Wiki should not get cloned -->
### 3. Run the code
Expand All @@ -135,28 +133,27 @@ These samples demonstrate different ways OMRChecker can be used.

#### Running it on your own OMR Sheets

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:)
1. First [create your own template.json](https://github.com/Udayraj123/OMRChecker/wiki/User-Guide).
2. Open `globals.py` and check the tuning parameters.
<!-- 3. Add answer key( TODO: add answer key/marking scheme guide) -->
3. Run OMRChecker with appropriate arguments.
#### Full Usage
```
python3 main.py [--setLayout] [--noCropping] [--autoAlign] [--inputDir dir1] [--outputDir dir1] [--template path/to/template.json]
```
Explanation for the arguments:

##### 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.
`--setLayout`: Set up OMR template layout - modify your json file and run again until the template is set.

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

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

`--inputDir`: Specify an input directory.
`--inputDir`: Specify an input directory.

`--outputDir`: Specify an output directory.
`--outputDir`: Specify an output directory.

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

<!-- #### Testing the code
Datasets to test on :
Expand Down Expand Up @@ -214,21 +211,16 @@ Here's a sneak peak of the [Android OMR Helper App(WIP)](https://github.com/Uday

<!-- Begin donate section -->
### Other ways you can contribute:
- Help OMRChecker cross 560 stars ⭐ to become #1 ([Currently #4](https://github.com/topics/omr)) on the "OMR" tag on github.
- Help OMRChecker cross 560 stars ⭐ to become #1 ([Currently #4](https://github.com/topics/omr)).
Current stars: [![GitHub stars](https://img.shields.io/github/stars/Udayraj123/OMRChecker.svg?style=social&label=Stars✯)](https://GitHub.com/Udayraj123/OMRChecker/stargazers/)

- [Buy Me A Coffee ☕](https://www.buymeacoffee.com/Udayraj123) - To keep my brain juices flowing and help me create more such projects 💡

- [![paypal](https://www.paypalobjects.com/en_GB/i/btn/btn_donate_LG.gif)](https://www.paypal.me/Udayraj123/500) - If this project saved you large costs on OMR Software licenses, or saved efforts to make one.
- If this project saved you large costs on OMR Software licenses, or saved efforts to make one. [![paypal](https://www.paypalobjects.com/en_GB/i/btn/btn_donate_LG.gif)](https://www.paypal.me/Udayraj123/500)

<!-- ![☕](https://miro.medium.com/fit/c/256/256/1*br7aoq_JVfxeg73x5tF_Sw.png) -->
<!-- [![paypal.me](https://www.paypalobjects.com/en_GB/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Z5BNNK7AVFVH8&source=url) -->
<!-- https://www.amazon.in/hz/wishlist/ls/3V0TDQBI3T8IL -->

<!-- End donate section -->
*Find OMRChecker on* [***Product Hunt***](https://www.producthunt.com/posts/omr-checker/) **|** [***Hacker News***](https://news.ycombinator.com/item?id=20420602) **|** [***Reddit***](https://www.reddit.com/r/computervision/comments/ccbj6f/omrchecker_grade_exams_using_python_and_opencv/) **|** [***Swyya***](https://www.swyya.com/projects/omrchecker)


[![GitHub stars](https://img.shields.io/github/stars/Udayraj123/OMRChecker.svg?style=social&label=Stars✯)](https://GitHub.com/Udayraj123/OMRChecker/stargazers/)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/Udayraj123/OMRChecker/pull/new/master)
[![Join](https://img.shields.io/badge/Join-on_Discord-purple.svg?style=flat-square)](https://discord.gg/qFv2Vqf)
*Find OMRChecker on* [***Product Hunt***](https://www.producthunt.com/posts/omr-checker/) **|** [***Hacker News***](https://news.ycombinator.com/item?id=20420602) **|** [***Reddit***](https://www.reddit.com/r/computervision/comments/ccbj6f/omrchecker_grade_exams_using_python_and_opencv/) **|** [***Swyya***](https://www.swyya.com/projects/omrchecker) **|** [![Join](https://img.shields.io/badge/Join-on_Discord-purple.svg?style=flat-square)](https://discord.gg/qFv2Vqf)
1 change: 1 addition & 0 deletions inputs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.gitignore
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="Disables page contour detection - used for images from a document scanner where page boundary is not visible.")
help="Disables page contour detection - used when page boundary is not visible e.g. document scanner.")
argparser.add_argument("-a", "--autoAlign", required=False, dest='autoAlign', action='store_true',
help="Enables automatic template alignment - use only when the paper was bent slightly when scanning.")
help="(experimental) Enables automatic template alignment - use if the scans show slight misalignments.")
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 6d55e9c

Please sign in to comment.