Skip to content

Commit

Permalink
fix: load answer key from image with working samples
Browse files Browse the repository at this point in the history
fix: compress images
  • Loading branch information
Udayraj123 committed Jan 25, 2023
1 parent ea75858 commit 3692500
Show file tree
Hide file tree
Showing 40 changed files with 241 additions and 862 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,20 +214,21 @@ Command: <code>python3 -m pip install --user --upgrade pip</code>
## Full Usage

```
python3 main.py [--setLayout] [--autoAlign] [--inputDir dir1] [--outputDir dir1]
python3 main.py [--setLayout] [--inputDir dir1] [--outputDir dir1]
```
Explanation for the arguments:
`--setLayout`: Set up OMR template layout - modify your json file and run again until the template is set.
`--autoAlign`: (experimental) Enables automatic template alignment - use if the scans show slight misalignments.
`--inputDir`: Specify an input directory.
`--outputDir`: Specify an output directory.
**Note:** The `--noCropping` flag has been replaced with including/excluding a 'CropPage' plugin in "preProcessors" of the template.json(see [samples](https://github.com/Udayraj123/OMRChecker/tree/master/samples)).
**Notes:**
- The old `--noCropping` flag has been replaced with the 'CropPage' plugin in "preProcessors" of the template.json(see [samples](https://github.com/Udayraj123/OMRChecker/tree/master/samples)).
- The old `--autoAlign` flag can now be toggled from config.json
<!-- #### Testing the code
Datasets to test on :
Expand Down
10 changes: 0 additions & 10 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@
help="Specify an output directory.",
)

argparser.add_argument(
"-a",
"--autoAlign",
required=False,
dest="autoAlign",
action="store_true",
help="(experimental) Enables automatic template alignment - \
use if the scans show slight misalignments.",
)

argparser.add_argument(
"-l",
"--setLayout",
Expand Down
Binary file removed samples/community/UPSC-mock/IMG_8441-min.jpg
Binary file not shown.
Binary file removed samples/community/UPSC-mock/IMG_8446-min.jpg
Binary file not shown.
100 changes: 0 additions & 100 deletions samples/community/UPSC-mock/answer_key.csv

This file was deleted.

Binary file added samples/community/UPSC-mock/answer_key.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions samples/community/UPSC-mock/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"dimensions": {
"display_height": 1800,
"display_width": 2400,
"processing_height": 2400,
"processing_width": 1800
},
"outputs": {
"show_image_level": 0
}
}
15 changes: 5 additions & 10 deletions samples/community/UPSC-mock/evaluation.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
{
"source_type": "csv",
"options": {
"answer_key_csv_path": "answer_key.csv"
"answer_key_csv_path": "answer_key.csv",
"answer_key_image_path": "answer_key.jpg",
"questions_in_order": ["q1..100"],
"should_explain_scoring": true
},
"marking_scheme": {
"DEFAULT": {"correct": "2", "incorrect": "-1/3", "unmarked": "0" },
"NON_NEGATIVE": {
"questions": ["q1..3"],
"marking": { "correct": "2", "incorrect": "0", "unmarked": "0" }
},
"BONUS_QUESTIONS": {
"questions": ["q5", "q6"],
"marking": { "unmarked": "2", "correct": "2", "incorrect": "2" }
}
"DEFAULT": {"correct": "2", "incorrect": "-2/3", "unmarked": "0" }
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 25 additions & 25 deletions samples/community/UPSC-mock/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
],
"qBlocks": {
"bookletNo": {
"orig": [589, 540],
"orig": [595, 545],
"bigGaps": [11, 11],
"gaps": [75, 68],
"qNos": [[["bookletNo"]]],
Expand All @@ -130,16 +130,16 @@
"orient": "V"
},
"subjectCode": {
"orig": [918, 500],
"orig": [914, 510],
"bigGaps": [11, 11],
"gaps": [43.125, 32.6],
"gaps": [43.0, 32.65],
"qNos": [[["subjectCode1", "subjectCode2"]]],
"qType": "QTYPE_INT"
},
"roll": {
"orig": [1215, 500],
"orig": [1200, 510],
"bigGaps": [11, 11],
"gaps": [43.125, 32.6],
"gaps": [43.0, 32.65],
"qNos": [
[
[
Expand All @@ -159,89 +159,89 @@
"qType": "QTYPE_INT"
},
"q01block": {
"orig": [480, 918],
"orig": [500, 927],
"bigGaps": [11, 11],
"gaps": [63.75, 32.73],
"gaps": [58.75, 32.65],
"qNos": [[["q1", "q2", "q3", "q4", "q5", "q6", "q7", "q8", "q9", "q10"]]],
"qType": "QTYPE_MCQ4"
},
"q11block": {
"orig": [480, 1245],
"orig": [500, 1258],
"bigGaps": [11, 11],
"gaps": [63.75, 32.73],
"gaps": [58.75, 32.65],
"qNos": [
[["q11", "q12", "q13", "q14", "q15", "q16", "q17", "q18", "q19", "q20"]]
],
"qType": "QTYPE_MCQ4"
},
"q21block": {
"orig": [480, 1569],
"orig": [495, 1589],
"bigGaps": [11, 11],
"gaps": [63.75, 32.73],
"gaps": [58.75, 32.65],
"qNos": [
[["q21", "q22", "q23", "q24", "q25", "q26", "q27", "q28", "q29", "q30"]]
],
"numQuestions": 10,
"qType": "QTYPE_MCQ4"
},
"q31block": {
"orig": [480, 1901],
"orig": [495, 1925],
"bigGaps": [11, 11],
"gaps": [63.75, 32.73],
"gaps": [58.75, 32.65],
"qNos": [
[["q31", "q32", "q33", "q34", "q35", "q36", "q37", "q38", "q39", "q40"]]
],
"qType": "QTYPE_MCQ4"
},
"q41block": {
"orig": [807, 918],
"orig": [811, 927],
"bigGaps": [11, 11],
"gaps": [63.75, 32.73],
"gaps": [58.75, 32.65],
"qNos": [
[["q41", "q42", "q43", "q44", "q45", "q46", "q47", "q48", "q49", "q50"]]
],
"qType": "QTYPE_MCQ4"
},
"q51block": {
"orig": [807, 1245],
"orig": [811, 1258],
"bigGaps": [11, 11],
"gaps": [63.75, 32.73],
"gaps": [58.75, 32.65],
"qNos": [
[["q51", "q52", "q53", "q54", "q55", "q56", "q57", "q58", "q59", "q60"]]
],
"qType": "QTYPE_MCQ4"
},
"q61block": {
"orig": [807, 1569],
"orig": [811, 1589],
"bigGaps": [11, 11],
"gaps": [63.75, 32.73],
"gaps": [58.75, 32.65],
"qNos": [
[["q61", "q62", "q63", "q64", "q65", "q66", "q67", "q68", "q69", "q70"]]
],
"qType": "QTYPE_MCQ4"
},
"q71block": {
"orig": [807, 1901],
"orig": [811, 1925],
"bigGaps": [11, 11],
"gaps": [63.75, 32.73],
"gaps": [58.75, 32.65],
"qNos": [
[["q71", "q72", "q73", "q74", "q75", "q76", "q77", "q78", "q79", "q80"]]
],
"qType": "QTYPE_MCQ4"
},
"q81block": {
"orig": [1125, 918],
"orig": [1125, 927],
"bigGaps": [11, 11],
"gaps": [63.75, 32.73],
"gaps": [58.75, 32.65],
"qNos": [
[["q81", "q82", "q83", "q84", "q85", "q86", "q87", "q88", "q89", "q90"]]
],
"qType": "QTYPE_MCQ4"
},
"q91block": {
"orig": [1125, 1245],
"orig": [1125, 1258],
"bigGaps": [11, 11],
"gaps": [63.75, 32.73],
"gaps": [58.75, 32.65],
"qNos": [
[
[
Expand Down
File renamed without changes.

This file was deleted.

Binary file not shown.
11 changes: 0 additions & 11 deletions samples/community/UmarFarootAPS/csv-ans-key/config.json

This file was deleted.

Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 3692500

Please sign in to comment.