H

Handwritten Code Scanner

Compiling handwritten code, scanned from your mobile in seconds!!

The problem Handwritten Code Scanner solves

Effective text input and editing methods are needed to support programming on touchscreen devices. Unfortunately, on existing small smartphones, the virtual keyboard might be inefficient and waste screen space. Handwriting may be a feasible text input technique for programming on touchscreen devices thanks to recent advancements in OCR techniques. Again, handwriting recognition is arguably the “holy grail” of OCR. We’re not there yet, but with the help of deep learning, we’re making tremendous strides. With this project we aim to simplify that just a little bit.

Application 1: More than 95% of schools in India still use traditional handwritten coding assignments, tests and practice. Thus students have to dry run their codes on paper by hand. Well, we faced it too and it was cumbersome and often ended in us over-estimating our ability to run a successful peice of code. What if they could just scan it like a barcode or QR code and have their code running? This could be used by students who have limited or no access to a computer, or simply do not want to waste time first writing their code on paper, then typing it out their phones/computers to execute them.

Application 2: Now in high school, not only you and your friends had difficulties with writing code on paper, your teacher, who had to read 100s of codes written by everyone and dry run them on paper plus award marks for it. It is practically hard to review each student's handwritten code line by line, making being a Computer Science instructor extremely challenging. As a result, it becomes a nightmare for the teacher, who may have to manually type and run each student's code or risk overlooking flaws. We help them scan their students' code in seconds, do minor tweaks and have it evaluated within another few seconds thus reducing the workload and time spent by a huuuge margin. All of this with a very simple and neat UI.

Challenges we ran into

  • Integrating different packages with each other, with the upgraded flutter sdk and even the android embedding for version 1. Plugins and packages which we wished to use relied on other dependencies which either weren’t maintained anymore, or were not upgraded to be used with current configurations of flutter apps. We had to make a lot of changes in default kotlin, android sdk and dependency versions and use hit-and-trial to make sure the application does not break.

  • Looking for developer resources was another task. Since code executions on flutter aren’t a very common problem statement, it was difficult to find third-party resources that we could use to get things running. API calls costing us tens of dollars per request, and almost no resources to use them with dart.

  • Detecting programming language from the scanned code was the most exhausting challenge and took most of our time during the hackathon. We wanted to split the code into words and then compare the occurrences of those words with known snippets, then predict the accuracy that that particular code was written in some language X for every language we were interested in and declare the language with highest probability. But we could never collect enough data to train the model and did not want to compromise on an inaccurate model.

Discussion