Giter VIP home page Giter VIP logo

Comments (3)

Foruck avatar Foruck commented on May 23, 2024

To combine our HAKE-large with other instance-level HOI detection methods (like iCAN), there are two circumstances:

  1. You are using the same object detection results as TIN and HAKE-large. For this, replace the score files as shown in the following code with corresponding result files.

    score_H = pickle.load(open('TIN/score_H.pkl', 'rb'))
    score_O = pickle.load(open('TIN/score_O.pkl', 'rb'))
    score_sp = pickle.load(open('TIN/score_sp.pkl', 'rb'))

    And if necessary, feel free to replace the scale factors and weights in the following code to fit the customized result.
    h_fac, o_fac, sp_fac, P_fac, A_fac, L_fac, hthresh, othresh, athresh, bthresh, P_weight, A_weight, L_weight = pickle.load(open('generation_args.pkl', 'rb'))

    And corresponding changes might be made to the following code.
    for hoi_index in range(x, y):
    score_H[obj_index][:, hoi_index - x] /= h_fac[hoi_index]
    score_O[obj_index][:, hoi_index - x] /= o_fac[hoi_index]
    score_sp[obj_index][:, hoi_index - x] /= sp_fac[hoi_index]
    score_P[obj_index][:, hoi_index - x] /= P_fac[hoi_index]
    score_A[obj_index][:, hoi_index - x] /= A_fac[hoi_index]
    score_L[obj_index][:, hoi_index - x] /= L_fac[hoi_index]
    hod = getSigmoid(9, 1, 3, 0, hdet[obj_index].reshape(-1, 1)) * getSigmoid(9, 1, 3, 0, odet[obj_index].reshape(-1, 1))
    sH = torch.sigmoid(torch.from_numpy(score_H[obj_index]).cuda()).cpu().numpy()
    sO = torch.sigmoid(torch.from_numpy(score_O[obj_index]).cuda()).cpu().numpy()
    ssp = torch.sigmoid(torch.from_numpy(score_sp[obj_index]).cuda()).cpu().numpy()
    sP = torch.sigmoid(torch.from_numpy(score_P[obj_index]).cuda()).cpu().numpy() * P_weight
    sA = torch.sigmoid(torch.from_numpy(score_A[obj_index]).cuda()).cpu().numpy() * A_weight
    sL = torch.sigmoid(torch.from_numpy(score_L[obj_index]).cuda()).cpu().numpy() * L_weight
    sHO = (((sH + sO) * ssp + sP + sA + sL) * score_I[im_index[keys[obj_index]], x:y]) * hod

  2. You are using different object detection result from TIN and HAKE-large. Besides replacing the score files, the other files also needs re-generation. Note that pos.pkl and neg.pkl are the interactiveness prediction results from TIN model.

    score_H = pickle.load(open('TIN/score_H.pkl', 'rb'))
    score_O = pickle.load(open('TIN/score_O.pkl', 'rb'))
    score_sp = pickle.load(open('TIN/score_sp.pkl', 'rb'))
    hdet = pickle.load(open('TIN/hdet.pkl', 'rb'))
    odet = pickle.load(open('TIN/odet.pkl', 'rb'))
    keys = pickle.load(open('TIN/keys.pkl', 'rb'))
    pos = pickle.load(open('TIN/pos.pkl', 'rb'))
    neg = pickle.load(open('TIN/neg.pkl', 'rb'))
    bboxes = pickle.load(open('TIN/bboxes.pkl', 'rb'))
    score_P = pickle.load(open(args.model + '/scores_P.pkl', 'rb'))
    score_A = pickle.load(open(args.model + '/scores_A.pkl', 'rb'))
    score_L = pickle.load(open(args.model + '/scores_L.pkl', 'rb'))

    If necessary, the scale factors, weights and code could also be changed following the above description.

And we will consider making our iCAN+HAKE-Large result public, while for better performance, TIN+HAKE-Large is still preferred.

from hake-action.

anon112233 avatar anon112233 commented on May 23, 2024

Thank you for the thorough response. As for making the iCAN+HAKE-Large code public, I think this would be a nice addition for people who want to tradeoff low complexity and low compute for some performance.

from hake-action.

Foruck avatar Foruck commented on May 23, 2024

Thanks for your advice! We will work on it.

from hake-action.

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.