Giter Club home page Giter Club logo

Comments (3)

jcjohnson avatar jcjohnson commented on May 18, 2024 1

My reply times are usually bimodal: either I respond right away or it will fall out of my inbox and be forgotten forever!

from sg2im.

jcjohnson avatar jcjohnson commented on May 18, 2024

In some of my earlier experiments I tried some additional relationships on COCO, defined as follows (replaces https://github.com/google/sg2im/blob/master/sg2im/data/coco.py#L337)

      touching = False
      if self.touching_relations:
        area_s = (sx1 - sx0) * (sy1 - sy0)
        area_o = (ox1 - ox0) * (oy1 - oy0)
        ix0, ix1 = max(sx0, ox0), min(sx1, ox1)
        iy0, iy1 = max(sy0, oy0), min(sy1, oy1)
        area_i = max(0, ix1 - ix0) * max(0, iy1 - iy0)
        iou = area_i / (area_s + area_o - area_i)
        touching = 0.1 < iou < 0.5

      if sx0 < ox0 and sx1 > ox1 and sy0 < oy0 and sy1 > oy1:
        p = 'surrounding'
      elif sx0 > ox0 and sx1 < ox1 and sy0 > oy0 and sy1 < oy1:
        p = 'inside'
      elif theta >= 3 * math.pi / 4 or theta <= -3 * math.pi / 4:
        p = 'right touching' if touching else 'left of'
      elif -3 * math.pi / 4 <= theta < -math.pi / 4:
        p = 'bottom touching' if touching else 'above'
      elif -math.pi / 4 <= theta < math.pi / 4:
        p = 'left touching' if touching else 'right of'
      elif math.pi / 4 <= theta < 3 * math.pi / 4:
        p = 'top touching' if touching else 'below'
      p = self.vocab['pred_name_to_idx'][p]
      triples.append([s, p, o])

However in the final models I didn't end up using these relationships. They are still present in the vocab of the pretrained models, but these relationships were not used at all during training and the embeddings associated with these relationships in the released model weights will be random. Thus if you try to pass a scene graph with one of these "touching" relationships, you will probably get a garbage output from the model.

from sg2im.

aluo-x avatar aluo-x commented on May 18, 2024

Many thanks for the impressively quick reply! Really appreciate the clarification!

from sg2im.

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.