Giter Site home page Giter Site logo

Comments (4)

geonm avatar geonm commented on September 24, 2024 1

Sorry for the late reply. I was on vacation.

Yes. This was intended.

center_scores is used for finding a rectangle lying in the center of the image.

I simply designed center_scores as a vector array for how far the center points of the squares are from the center point of the image.

square_centers are the center points of all detected rectangles and centers (should be center 😄 ) is the center of the image.

As shown in

mlsd/utils.py

Lines 461 to 466 in 53a0161

###################################### CENTER SCORES
centers = np.array([[256 // 2, 256 // 2]], dtype='float32') # [1, 2]
# squares: [n, 4, 2]
square_centers = np.mean(squares, axis=1) # [n, 2]
center2center = np.sqrt(np.sum((centers - square_centers) ** 2))
center_scores = center2center / (map_size / np.sqrt(2.0))
, this was intended.

NOTE: center_scores is not a scala value.

from mlsd.

geonm avatar geonm commented on September 24, 2024 1

It has been fixed #22.

mlsd/utils.py

Line 465 in 1c25206

center2center = np.sqrt(np.sum((centers - square_centers) ** 2, axis=1))

Thanks!

from mlsd.

whwnsdlr1 avatar whwnsdlr1 commented on September 24, 2024

thank to reply
But if center_array is a vector and not a scalar then axis=1 isn't what you need?
center2center = np.sqrt(np.sum((centers - square_centers) ** 2))
-> a = (centers - square_centers) ** 2 # (n, 2)
-> b = np.sum(a) # scalar, np.sum reduce 0d
-> center2center = np.sqrt(b) # scalar

If np.sum with axis=1
-> a = (centers - square_centers) ** 2 # (n, 2)
-> b = np.sum(a, axis = 1) # (n,)
-> center2center = np.sqrt(b) # (n,)

from mlsd.

geonm avatar geonm commented on September 24, 2024

@whwnsdlr1

Thanks for your comment.

Yes, you are right.

The line 466

mlsd/utils.py

Line 465 in 53a0161

center2center = np.sqrt(np.sum((centers - square_centers) ** 2))
should be modified to follow above my comment.

I will fix it. Thank you again.

from mlsd.

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.