1

I was trying to run a python project located here which is for ad detection inside a video. I installed the required dependencies on my Ubuntu 16.04 (by running the dependencies.sh). I changed the comdet.py main part to account for my input file:

def test_recognize():

    #input_file_path = '../test/test.mp4'
    input_file_path = '../test/nadal-news.mp4'
    ad_det = ComDet()
    ad_det.recognize_ads_file(input_file_path)

if __name__ == '__main__':
    #test_generate()
    test_recognize()

Based on the instruction, I just do python2.7 comdet.py. After a few dependencies and import problems, now it complaints about not being connected to the local SQL database:

_mysql_exceptions.OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' (111)")

What is the problem?

I thought maybe I should run start-server.sh located in src/web, but that does nothing. I'm new to python.

UPDATE: I set a password for my mysql installation. And then I update the password in comdet.py as below. Plus, I have to manually create a database called devaju in mysql command line.

config.setdefault('database', {
                            "host": "127.0.0.1",
                            "user": "root",
                            "passwd": "root",
                            "db": "dejavu"
                            })

Now the program runs, but nothing happens. No prints, nothing. Maybe I'm doing something wrong?

Tina J
  • 4,983
  • 13
  • 59
  • 125
  • 1
    Can you connect at all to your sql server like : `mysql -u root -h 127.0.0.1 -p` – user1767754 Dec 02 '17 at 00:45
  • Ummm, no. It asks for a root password. I left it blank during installation, but it doesn't accept blank. Is there a default password. – Tina J Dec 02 '17 at 00:48
  • 1
    Normally you set it when installing, you can find some solutions for that here: https://stackoverflow.com/questions/5683154/how-do-i-find-out-my-root-mysql-password – user1767754 Dec 02 '17 at 00:50
  • 1
    Error `111` means `Connection refused`, better provide your connection string – Sherry Dec 02 '17 at 01:49
  • 1
    are you using SQL lite or MySQL ?? i have checked the github project folder, looks like settings is pointing to sqllite but the dependency is pointing to mysql . which database are you using ? if you are using MySQL, have you modified the settings.py file. – Saji Xavier Dec 02 '17 at 04:02
  • I just installed mysql as instructed. Sudo apt-get install python-mysql i guess. – Tina J Dec 02 '17 at 05:00
  • @Sherry what do u mean of connection string? The code is already there. – Tina J Dec 02 '17 at 05:01
  • updated the question! – Tina J Dec 02 '17 at 05:56

0 Answers0