srbcheema1 / CoolKit

CoolKit is Coding + ToolKit, A command-line tool used to automate your programming experience.
https://pypi.org/project/coolkit/
MIT License
7 stars 7 forks source link

Add the Hacking framework #10

Open nimitbhardwaj opened 5 years ago

nimitbhardwaj commented 5 years ago

I propose an idea which may be very useful for hacking, when we do the contest, we can hack other solutions, we need to see the code for it, and its not able to be copied just an img, so idea is to convert img to text, run the code, compare its working with our solution by some random test cases, this way it will be fine and easy to obtain cases for hack

srbcheema1 commented 5 years ago

@nimitbhardwaj, I too had this thing in mind. The image-reading is the main bottle-neck in this. I would love to implement it if you would implement or provide a small module to read image accurately that could be like img_to_code('image/path') which returns a text output.

rathod-sahaab commented 5 years ago

tesseract-ocr is the solution

from PIL import Image
import pytesseract as tes
print(tes.image_to_string(Image.open('~/Desktop/maxresdefault.jpg')))
rathod-sahaab commented 5 years ago

maxresdefault

Output

ploverpython.py + (c:\proj) - GVIM
action = _Action()
last_word = last_action.word
last_glue = last_action.glue
last_attach = last_action.attach
last_capitalize = last_action.capitalize
last_lower = last_action. lower
last_orthography = last_action.orthography
meta = _get_meta(atom)
if meta is not None:
meta = _unescape_atom(meta)
1 tO ts
action.text = meta
Cv BG t-te Wo ao
action.text = meta
action.capitalize = True
action. lower = False
elif meta == META_CAPITA|

ET g Titer ee C cdi
rathod-sahaab commented 5 years ago

By the way got the image online :P

srbcheema1 commented 5 years ago

seems like we could do it now. if its accuracy is >= 98%