GithubHelp home page GithubHelp logo

How to get a subspace in W+? about ice HOT 1 OPEN

Kihensarn avatar Kihensarn commented on July 1, 2024
How to get a subspace in W+?

from ice.

Comments (1)

prclibo avatar prclibo commented on July 1, 2024

You can refer to the following code in the discover_subspace.ipynb.

if task == 'eye_photo_act_mp_sup_mp':
    for space, magnitude in zip(['s'], [20]): # zip(['s', 'w+', 'w', 'z'], [8, 2, 2, 1]):
        dataloader = dataloader_to(zs0[:2], space)
        nose_segmenter = FaceSegmenter(segmenter_path, mask_labels=[4, 5, 6], morphology='dilation', ks_ratio=0.1).to(device)
        f_photo = MaskedMSE(generator, space, nose_segmenter, (48, 48), return_complementary=True)

        JtJs_photo = load_or_compute(cache_path % (space, task, 'photo'), lambda: find_jtj_direct(f_photo, dataloader), recompute=False, map_location=device)
        with torch.no_grad():
            s_act, v_act = compute_early_projected_pca(JtJs_photo[0],[JtJs_photo[1]], sup_ratio=[1e-3])

            torch.save([s_act, v_act], span_path % (space, task))
            visualize(zs0[[21, 30]], space, magnitude, v_act, steps=[ -1, 1], selector=range(10))

Basically this code changes the region marked by nose_segmenter (wrong name, should be eye_segmenter) while preserving the rest region (as you need). For W+ space, just assign "w+" to space.

from ice.

Related Issues (2)

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.