Giter Club home page Giter Club logo

Comments (2)

alexsun009 avatar alexsun009 commented on August 17, 2024

As an added on, looks this issue only happens with supervised:Ture(SS-DCNet),
and training the S-DCNet version do not have such issue.

supervised: False
True for the Supervised S-DCNet (SS-DCNet)
False for the older version (unsupervised, ordinary S-DCNet)

Thanks

from s-dcnet.

dmburd avatar dmburd commented on August 17, 2024

Hi,
essentially, only batch size == 1 is supported. The reasons for that are:

  1. The input images have different resolutions;
  2. After the augmentations that change the input sample resolution (QuasiRandomCrop and PadToMultipleOf64 in ShanghaiTech_dataset.py) the samples still have different resolutions.
    No preprocessing is done in order to make the samples have the same resolution. It would complicate preprocessing and significantly reduce the meaningful part of a sample area.

Consider a case when you have two input images, the 1st one has landscape orientation, and the 2nd one has portrait orientation. How can we make them have the same resolution in order to put them into the same batch? Simple resizing that changes aspect ratio is not allowed (because of the nature of the problem -- the network should always see the same natural aspect ratio of people's bodies and heads). The only option would be to choose an excessive frame size that would cover both input images simultaneously and pad the images by zeros to fit them to the chosen excessive frame size. In that case, the meaningful parts of the images become relatively small and the network forward pass time increases. I decided not to deal with such negative effects. This issue can be even more pronounced if there are, say, 4 images that you want to put into the same batch.

from s-dcnet.

Related Issues (14)

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.