Coder Social home page Coder Social logo

Import error about ocr_tablenet HOT 5 CLOSED

tomassosorio avatar tomassosorio commented on July 20, 2024
Import error

from ocr_tablenet.

Comments (5)

LivingDeadCloud avatar LivingDeadCloud commented on July 20, 2024 1

Ok, after some debugging I was able to run the code.
If you want, I could post my code here, so that users that will have to use Google Colab have it ready.

Let me know!

Cheers

from ocr_tablenet.

LivingDeadCloud avatar LivingDeadCloud commented on July 20, 2024 1

@LivingDeadCloud, thanks! If you don't mind I would appreciate it!

Sorry, I did not have time to help you in between... :/

Yeah no problem, I will post it next week!

from ocr_tablenet.

LivingDeadCloud avatar LivingDeadCloud commented on July 20, 2024 1

Hey everyone

Sorry for the delay. I'm going to post the code now. Just notice that I haven't used the code ever since my original post, so it may need some small adjustment.
Here's my code to run TableNet in Google Colab:

# Mount drive
from google.colab import drive
drive.mount('/content/drive', force_remount=True)

# Install all requirements
!pip install -r /content/drive/MyDrive/TableNet/requirements.txt # Change this with the path to requirements.txt

# Install additional packages
!pip install tesseract
!pip install torchtext==0.8.0
!pip install torch==1.7.1 
!pip install pytorch-lightning==1.2.2
!pip install torchmetrics
!pip install deprecate
!apt install tesseract-ocr
!apt install libtesseract-dev

# Run the code
# python predict.py --model_weights='<weights path>' --image_path='<image path>' # Default command line
result = !python /content/drive/MyDrive/TableNet/predict.py --model_weights='/content/drive/MyDrive/TableNet/best_model.ckpt' --image_path='/content/drive/MyDrive/TableNet/TablesImages/Your_image.png' # Change paths to "predict.py" and "Your_image.png" according to your drive

# Look the result
result

Now, result is a IPython.utils.text.SList type variable, so here you may need some adjustments to predict.py function. However it should be pretty straightforward from here.
If someone is willing to post their code to get result as a more useful type of variable, for exampel a Pandas dataframe, that would be great!

Cheers

from ocr_tablenet.

tomassosorio avatar tomassosorio commented on July 20, 2024 1

@LivingDeadCloud Thanks! I will add this to README.md

from ocr_tablenet.

tomassosorio avatar tomassosorio commented on July 20, 2024

@LivingDeadCloud, thanks! If you don't mind I would appreciate it!

Sorry, I did not have time to help you in between... :/

from ocr_tablenet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.