Comments (15)
Hi @thealchemist89,
I'm a newbie too but I'm also working on the training of YOLO so maybe I can help you a little with my tiny knowledge.
To create my own dataset with annotations I personally use labelImg but I know that others use BBox-Label-Tool. I prefer labelImg just because you have the annotations in the Pascal VOC format. So, to use your data for YAD2K, you'll have to you a parser to create annotation with the good format. (In python it's easy because the annotation file is in xml)
To train YAD2K you have a script called retain_yolo.py
. You just have to provided a .npz
file witch contain your data. To create this file, you can used this project witch is provided by @shadySource (who provided also the retrain_yolo.py
script).
You just have to execute the script. I don't remember if you need to modified the .cfg for this version, maybe others know that. You also have to created the .txt
with your classes.
I had some issues to train my own data because my images had different shapes. If this happen to you too you can check this post to see how solve this problem.
I do not know whether I am clear in my remarks. If you need more explication just ask and if I understand the problem I will answe !
I sorry for my English if it's not clear or if there is a lot of mistakes !
from yad2k.
@thealchemist89
retrain_yolo.py
currently resizes (stretches/shrinks) all images and their corresponding labels to a fixed size for easy training with keras. Also, the way training data is loaded now requires all training images to have the same dimensions. The post is near the bottom here.retrain_yolo.py
is already configured to load the pre-trained model of yolo then re-train it for another dataset (it already does transfer learning). If you need help understanding how to use it, I could write a small tutorial. The readme does need to be updated with this information.
from yad2k.
from yad2k.
Thank you Ahziel, you explained it very well. And, I appreciate very much your time and patience in writing so clearly. If I may ask 2 more questions:
-
May I know which post you are referring to that helps us to handle images with different shapes?
-
How can we build our dataset on-top of the pre-trained model of YOLO? I'm trying to do transfer learning hoping not to re-train everything. Do you know where in the code we can do this?
Thank you for helping!
from yad2k.
@shadySource
Thank you so much for your kind direction. I will follow up based on your suggestions, a tutorial will certainly be great!
from yad2k.
I labelled my images using labelImg, just contributing my code to parse the xml files to the format used by @shadySource package_dataset2.py
Hope this can help newbies working with YAD2K :)
import xml.etree.ElementTree as ET
import os
dir = 'data/xmls' #directory containing xml files
f= open("data.csv","w+") #csv file name
for files in os.listdir(dir):
tree = ET.parse(os.path.join(dir,files))
root = tree.getroot()
file_name = root.find('filename').text
for object in root.findall('object'):
obj_name = object.find('name').text
bndbox = object.find('bndbox')
xmin = bndbox.find('xmin').text
ymin = bndbox.find('ymin').text
xmax = bndbox.find('xmax').text
ymax = bndbox.find('ymax').text
string = ' '.join([file_name,xmin,ymin,xmax,ymax,'0',obj_name,'\n'])
f.write(string)
from yad2k.
@00desire hi,can you share your code with me ,here is my emial ([email protected])
from yad2k.
First use labelImg-master to convert the boxed pictures into VOC Annotated format the use my utility from the link below to convert the VOC Annotated Files to npz so that you can train your own custom data using YAD2K
https://github.com/MATRIX4284/VOC_NPZ
from yad2k.
Hey, I have image text files which I generated from the LabelImg project. I am facing quite some trouble parsing it when there are multiple objects in an image file.
from yad2k.
@priyamehta01 refer to the code i provided above using the Element Tree library to parse the xml files to find specific objects.
from yad2k.
@shadySource
you mentioned that retrain_yolo.py currently resizes (stretches/shrinks) all images and their corresponding labels to a fixed size for easy training with keras.
However, in the package_dataset.py, u resize img ? Why was that ? I thought retrain_yolo.py already handled it.
What should I do if I have different sizes of img ?
Can I label them and then resize ? or I have to resize before labeling ?
Thank you !
from yad2k.
from yad2k.
from yad2k.
from yad2k.
from yad2k.
Related Issues (20)
- weird error
- when trying'./yad2k.py yolo.cfg yolo.weights model_data/yolo.h5', has problem HOT 2
- retrain_yolo image size/shape (416,416 vs 416,416,3)
- Difference between yad2k.py and yad2k/models/keras_yolo.py?
- Replace session.run() with keras Model
- ValueError: Cannot feed value of shape (1, 416, 416) for Tensor 'input_1:0', which has shape '(?, 416, 416, 3)' HOT 2
- The bounding box shifts
- The bounding box shifts right or left from the target.
- I try to generate yolo.h5 and use this command: python yad2k.py yolo.cfg yolo.weights model_data/yolo.h5 HOT 4
- when I run the code "yolo_model = load_model("model_data/yolov2.h5")" always raise an error HOT 1
- Using darknet19 as a simple classifier
- AttributeError: Module 'tensorflow' has no attribute 'space_to_depth" HOT 4
- issue with model last layer
- Generate yolo.h5 file HOT 1
- detects only 10 objects on max
- wget yolo cfg doesn't work HOT 1
- ReLu Activation Function HOT 1
- convert yolo9000.weights error
- Attempting to use uninitialized value FeatureExtractor/MobilenetV2/expanded_conv_3/depthwise/BatchNorm/beta [[{{node _retval_FeatureExtractor/MobilenetV2/expanded_conv_3/depthwise/BatchNorm/beta_0_179}}]] HOT 1
- issues with config_path weights_path output_path
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yad2k.