Code Monkey home page Code Monkey logo

Comments (8)

knaticat avatar knaticat commented on July 18, 2024 1

Hi there, although I didn't try training the model on a custom dataset myself. What I understand from your approach is that I see the MAX_LABEL value should indicate the number of identities you are training with and not the class i.e for the Market1501 dataset there were 1501 individuals (but 1 class = people). Just to get an idea about how to structure your data you could see how the images and directories are labelled in the Market1501 or mars dataset available in kaggle (saves you downloading time). Then try to label your images accordingly if you want to stick to the code in this repo. I am not sure about the minimum number of images that would be enough but more is always better.

from cosine_metric_learning.

knaticat avatar knaticat commented on July 18, 2024 1

Here you go:

  1. If by single identity you mean you have a bunch of drones with similar (or even near identical) appearance, I am not sure if the deep appearance features would be distinguishable enough. The person or vehicle re-id datasets have image identities that seem quite distinguishable like dress color, vehicle color etc. which if I understand correctly help the model during re-id.
  2. Yeah the images have to be frame by frame object moves and if possible from different camera locations. I don't think any bounding box annotations are required as such.
  3. Yeah cropped images should do. You can even reshape the dimensions of the network from the mars.py or market1501.py files using the IMAGE_SHAPE parameter.

from cosine_metric_learning.

knaticat avatar knaticat commented on July 18, 2024 1

Just to clarify if I understand correctly you aren't tracking just a single drone right? Identities arise when say you have 10 drones (can be of same model) and you collect images of each one at various angles so that during occlusions or missing tracks the network re-IDs the same drone and not a different one. One work around might be adding visual color tags to the drones if possible so it can act as a distinguishing appearance feature. However these are my speculations and I am not sure whether the network really works well in extracting and differentiating minute appearance features even if the objects are near identical.

For the input image size of the network, I guess stick with the default values if possible. Check issue #40. I cannot help in this matter cause I didn't train a custom data set myself and don't know about the errors that may arise. However, feel free to experiment & update your results here :-)

from cosine_metric_learning.

dylantzx avatar dylantzx commented on July 18, 2024

Just an update, I tried using purely cropped images, where I cropped based on the bounding boxes received from the object detection of my moving object, with 5 pixels extra on each side of the bounding box. I then manually filtered away some images which barely had the object inside and renamed the file names with a python script.

I only have 1 class, so I set my MAX_LABEL = 1 and tried training with just 254 cropped images, which caused a problem mentioned in #9

EnqueueError: Cannot take a larger sample than population when 'replace=False'

I resolved this by changing the batch_size = 4

I am planning to increase my training dataset to about 1000 images, but I am not sure if:

  1. What I've done to train for a custom dataset is correct?
  2. Is 1000 images enough?

I am also unable to run the evaluation script as I keep facing the issue mentioned in #41 where I have something like

"ValueError: input must have last dimension >= k = 5 but is 2 for 'TopKV2_1' (op: 'TopKV2') with input shapes: [2,2], [] and with computed input tensors: input[1] = <5>"

which doesn't have a working solution to it so far

@nwojke Would be great if I could get some insights!

from cosine_metric_learning.

dylantzx avatar dylantzx commented on July 18, 2024

@knaticat Ahhh I see! Thank you so much!

I see the MAX_LABEL value should indicate the number of identities you are training with and not the class i.e for the Market1501 dataset there were 1501 individuals (but 1 class = people)

Hope you won't mind me asking more questions but for my use case, I am trying to track a drone in a simulation env (Gazebo), and only have 1 identity. So does this mean that:

  1. I would have to get images of different drone models as well? Would you know how this helps in object tracking?
  2. I have seen the images in the MARs dataset but may I clarify again that every picture has to be frame by frame according to how the object moves?
  3. I am structuring my dataset similar to the Mars dataset, but what I'm unclear about is if there needs to be any labelling like in object detection, or would cropped images of the object be fine.

from cosine_metric_learning.

dylantzx avatar dylantzx commented on July 18, 2024

@knaticat Thank you! This has really helped clarify some of my doubts!

For (1):
I am only going to be tracking a single type of drone for now so it should be fine if I just have 1 identity with many images right? Would you happen to know?

For (3):
May I know how would changing the IMAGE_SHAPE parameter help and how I can go about doing so? I apologize if my understanding of the deep sort algorithm is lacking. Is this parameter used for resizing the cropped image into a larger image for better feature extraction?

I currently have it set as IMAGE_SHAPE = 128, 64, 3 so does this mean that I should set a larger image shape then? Doing this should not affect the inference time in any way right? It should probably only increase the training time since I am inputting a larger image now?

Also, are there any rules to follow for setting the IMAGE_SHAPE? I observed that IMAGE_SHAPE = 256, 128, 3 has been used in mars.py so IMAGE_SHAPE = 512, 256, 3 would be fine as well? How would I know which is the best?

from cosine_metric_learning.

dylantzx avatar dylantzx commented on July 18, 2024

Ahh I see. Thank you for the suggestions! Guess I'll just have to experiment and see how it goes. Appreciate your help!

from cosine_metric_learning.

blackCmd avatar blackCmd commented on July 18, 2024

Ahh I see. Thank you for the suggestions! Guess I'll just have to experiment and see how it goes. Appreciate your help!

I want to train custom dataset too !
Are you success?

from cosine_metric_learning.

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.