Giter VIP home page Giter VIP logo

Comments (8)

lars76 avatar lars76 commented on May 28, 2024 1

Maybe my installation instructions were not clear enough.

  1. wget http://www.robots.ox.ac.uk/~vgg/data/pets/data/images.tar.gz
  2. wget http://www.robots.ox.ac.uk/~vgg/data/pets/data/annotations.tar.gz
  3. tar xf images.tar.gz
  4. tar xf annotations.tar.gz
  5. mv annotations/xmls/* images/
  6. Change DATASET_FOLDER
  7. python3 generate_dataset.py (maybe also install imgaug if you want better results)

The file train.csv will now contain lines like this:
/home/lars/Downloads/images/Abyssinian_1.jpg,1,600,400,173,72,265,158
/home/lars/Downloads/images/Abyssinian_10.jpg,1,375,500,72,105,288,291
...

I hope now it works for you guys

from object-localization.

lars76 avatar lars76 commented on May 28, 2024

Hi, check whether you set the right path (DATASET_FOLDER) in generate_dataset.py. Did you use a new dataset or Oxford-IIIT? If you use a new dataset, you will have to change generate_dataset.py. The script train_model.py expects the following columns in the csv file: path, class_id, width, height, x0, y0, x1, y1

from object-localization.

iamthealphamale avatar iamthealphamale commented on May 28, 2024

Yes, I pasted the path of the dataset folder and used original dataset for now.
As an alternative, could you please upload train.csv and validation.csv here so I could have a look? I would really appreciate it!

from object-localization.

emilianooddo avatar emilianooddo commented on May 28, 2024

Hi Lars, I've the same problem of imthealphamale. why this problem?
thanks a lot.
Best regards.

from object-localization.

emilianooddo avatar emilianooddo commented on May 28, 2024

oh, yes..that's great! Now, it's work! Thank you so much, lars! last one thing, how I can use my gpu for training?How can I set it?

Best regards

from object-localization.

lars76 avatar lars76 commented on May 28, 2024

No problem, you can enter in the terminal python3 -c "from keras import backend as K; print(K.tensorflow_backend._get_available_gpus())" to check whether Keras uses your GPU. Otherwise you have to configure it. Normally, you don't have to set /device:GPU:0 manually.

from object-localization.

dhuruvapriyan avatar dhuruvapriyan commented on May 28, 2024

use this script to change xml files to single .csv files:

###code starts here###
import os
import glob
import pandas as pd
import xml.etree.ElementTree as ET

xml_list = []
for xml_file in glob.glob('C:/Users/-----/*.xml'): #enter the path of the xml folder
print("hi")
tree = ET.parse(xml_file)
root = tree.getroot()
for member in root.findall('object'):
print("hi")
value = (root.find('filename').text,
int(root.find('size')[0].text),
int(root.find('size')[1].text),
member[0].text,
int(member[4][0].text),
int(member[4][1].text),
int(member[4][2].text),
int(member[4][3].text)
)
xml_list.append(value)

column_name = ['filename', 'width', 'height', 'class', 'xmin', 'ymin', 'xmax', 'ymax']
xml_df = pd.DataFrame(xml_list, columns=column_name)
xml_df.to_csv('train_test.csv', index=None)
print('Successfully converted xml to csv.')

###code ends here###

from object-localization.

laurasels avatar laurasels commented on May 28, 2024

image

I get also an empty train.csv. Is this because the folder 'annotations' is not in the right directory? See image of my directories.


Okay it works! I had to move the annotations folder into the images folder. I used the commando 5. mv annotations/xmls/* images/ as in the instructions, but now it works!

from object-localization.

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.