An implementation of the WHATWG URL Standard in JavaScript

Overview

whatwg-url

whatwg-url is a full implementation of the WHATWG URL Standard. It can be used standalone, but it also exposes a lot of the internal algorithms that are useful for integrating a URL parser into a project like jsdom.

Specification conformance

whatwg-url is currently up to date with the URL spec up to commit 43c2713.

For file: URLs, whose origin is left unspecified, whatwg-url chooses to use a new opaque origin (which serializes to "null").

whatwg-url does not yet implement any encoding handling beyond UTF-8. That is, the encoding override parameter does not exist in our API.

API

The URL and URLSearchParams classes

The main API is provided by the URL and URLSearchParams exports, which follows the spec's behavior in all ways (including e.g. USVString conversion). Most consumers of this library will want to use these.

Low-level URL Standard API

The following methods are exported for use by places like jsdom that need to implement things like HTMLHyperlinkElementUtils. They mostly operate on or return an "internal URL" or "URL record" type.

The stateOverride parameter is one of the following strings:

The URL record type has the following API:

These properties should be treated with care, as in general changing them will cause the URL record to be in an inconsistent state until the appropriate invocation of basicURLParse is used to fix it up. You can see examples of this in the URL Standard, where there are many step sequences like "4. Set context object’s url’s fragment to the empty string. 5. Basic URL parse input with context object’s url as url and fragment state as state override." In between those two steps, a URL record is in an unusable state.

The return value of "failure" in the spec is represented by null. That is, functions like parseURL and basicURLParse can return either a URL record or null.

whatwg-url/webidl2js-wrapper module

This module exports the URL and URLSearchParams interface wrappers API generated by webidl2js.

Development instructions

First, install Node.js. Then, fetch the dependencies of whatwg-url, by running from this directory:

npm install

To run tests:

npm test

To generate a coverage report:

npm run coverage

To build and run the live viewer:

npm run prepare
npm run build-live-viewer

Serve the contents of the live-viewer directory using any web server.

Supporting whatwg-url

The jsdom project (including whatwg-url) is a community-driven project maintained by a team of volunteers. You could support us by:

  • Getting professional support for whatwg-url as part of a Tidelift subscription. Tidelift helps making open source sustainable for us while giving teams assurances for maintenance, licensing, and security.
  • Contributing directly to the project.
Comments
  • browserify support?

    browserify support?

    This lib is written with ES6, so it doesn't get parsed correctly with browserify:

    Parse error at -:3082,12
    SyntaxError: Unexpected token: name (x)
    Error
    

    It'd be great if there were a browser version available to serve as a polyfill for IE.

    opened by stevenvachon 30
  • How to get/set query string parameters?

    How to get/set query string parameters?

    Has URLUtils.searchParams been removed?

    What is the best way to do this?

    Unrelated: Why doesn't URL use the same terminology as RFC3986? (protocol -> scheme, hash -> fragment, search -> query, etc.)

    opened by glen-84 27
  • ReferenceError: TextEncoder is not defined

    ReferenceError: TextEncoder is not defined

    Relative from: https://github.com/Automattic/mongoose/issues/10713

    In https://github.com/jsdom/whatwg-url/blob/master/src/encoding.js line 2 says:

    "use strict";
    const utf8Encoder = new TextEncoder();
    const utf8Decoder = new TextDecoder("utf-8", { ignoreBOM: true });
    

    But node show an error message:

    /app/node_modules/whatwg-url/dist/encoding.js:2
    const utf8Encoder = new TextEncoder();
                        ^
    
    ReferenceError: TextEncoder is not defined
        at Object.<anonymous> (/app/node_modules/whatwg-url/dist/encoding.js:2:21)
        at Module._compile (internal/modules/cjs/loader.js:778:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
        at Module.load (internal/modules/cjs/loader.js:653:32)
        at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
        at Function.Module._load (internal/modules/cjs/loader.js:585:3)
        at Module.require (internal/modules/cjs/loader.js:692:17)
        at require (internal/modules/cjs/helpers.js:25:18)
        at Object.<anonymous> (/app/node_modules/whatwg-url/dist/url-state-machine.js:5:34)
        at Module._compile (internal/modules/cjs/loader.js:778:30)
    

    My node version:

    $ node -v
    v14.17.5
    
    $ npm -v
    6.14.14
    

    The version in package.json of dependency is:

    {
      "_from": "whatwg-url@^9.1.0",
      "_id": "[email protected]",
    

    I installed from mongoose package but have last version of whatwg-url package.

    opened by yhojann-cl 16
  • Update to latest spec

    Update to latest spec

    There's a problem with our URLSearchParams constructor. We explicitly check the objects prototype there, which is not correct, I think, which then fails one of the w3c tests.

    opened by Sebmaster 14
  • "new.target" can't be minified

    In URL.js:

    function URL(url) {
      if (!new.target) {
        throw new TypeError(
          "Failed to construct 'URL'. Please use the 'new' operator; this constructor cannot be called as a function."
        );
      }
    

    Where does this variable new even come from?

    opened by stevenvachon 12
  • URL is not a constructor

    URL is not a constructor

    I'm trying to work with this library. When I try to use it in a new URL(url) way, it says: Type Error: URL is not a constructor

    When I try to use it as function, it says: Type Error: Failed to construct 'URL'. Please use the 'new' operator; this constructor cannot be called as a function.

    I'm using node v6.10.3

    opened by israelidanny 11
  • webidl upgrade broke API in 8.2.0

    webidl upgrade broke API in 8.2.0

    I'm not at all a JS expert but after getting silently upgraded to 8.2.0 I'm seeing the following error in my build:

    TypeError: Cannot read property 'some' of undefined
        at Object.exports.install (/Users/mhughe008/development/vise/node_modules/whatwg-url/dist/URL.js:84:20)
        at exports.installInterfaces (/Users/mhughe008/development/vise/node_modules/jsdom/lib/jsdom/living/interfaces.js:202:24)
        at setupWindow (/Users/mhughe008/development/vise/node_modules/jsdom/lib/jsdom/browser/Window.js:63:3)
        at new Window (/Users/mhughe008/development/vise/node_modules/jsdom/lib/jsdom/browser/Window.js:107:3)
        at exports.createWindow (/Users/mhughe008/development/vise/node_modules/jsdom/lib/jsdom/browser/Window.js:38:10)
    

    Failing at this section of code:

    exports.install = (globalObject, globalNames) => {
      if (!globalNames.some(globalName => exposed.has(globalName))) {
        return;
      }
      class URL {
        constructor(url) {
          if (arguments.length < 1) {
    

    This is using jsdom 16.1.2. Best I can tell this was probably caused by the upgrade to webidl-conversions:

    -    "webidl-conversions": "^5.0.0"
    +    "webidl-conversions": "^6.1.0"
    
    opened by matthughes 10
  • Safari can't load URL.js

    Safari can't load URL.js

    Safari in macOS High Sierra and iOS 11.02 13604.1.38.1.6 fails on URL.js with:

    new.target can't come after a prefix operator

    Issue is webkit, but workaround needs to be applied to webidl2js (and a new version of whatwg-url built). See https://github.com/jsdom/webidl2js/issues/78.

    opened by mikemaccana 10
  • Validation error should not terminate the parser

    Validation error should not terminate the parser

    A validation error indicates a mismatch between input and valid input. User agents, especially conformance checkers, are encouraged to report them somewhere.

    NOTE:

    A validation error does not mean that the parser terminates. Termination of a parser is always stated explicitly, e.g., through a return statement.

    It is useful to signal validation errors as error-handling can be non-intuitive, legacy user agents might not implement correct error-handling, and the intent of what is written might be unclear to other developers.

    It seems that this script throws 'TypeError: Invalid URL' upon a validation error, but that terminates the parser, preventing the availability of the parsed URL parts. This confuses, for example, Live URL Viewer.

    opened by GPHemsley 10
  • ReferenceError: TextEncoder is not defined

    ReferenceError: TextEncoder is not defined

    Got this error on Docker Ubuntu, whatwg-url got from npm i whatwg-url:

    const utf8Encoder = new TextEncoder();
                        ^
    
    ReferenceError: TextEncoder is not defined
    
    
    Full Error Log

    yes, even hidden code blocks!

    [email protected]:/app/ApiServer# npm start
    
    > [email protected] start /app/ApiServer
    > node index.js
    
    /app/ApiServer/node_modules/whatwg-url/dist/encoding.js:2
    const utf8Encoder = new TextEncoder();
                        ^
    
    ReferenceError: TextEncoder is not defined
        at Object.<anonymous> (/app/ApiServer/node_modules/whatwg-url/dist/encoding.js:2:21)
        at Module._compile (internal/modules/cjs/loader.js:778:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
        at Module.load (internal/modules/cjs/loader.js:653:32)
        at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
        at Function.Module._load (internal/modules/cjs/loader.js:585:3)
        at Module.require (internal/modules/cjs/loader.js:692:17)
        at require (internal/modules/cjs/helpers.js:25:18)
        at Object.<anonymous> (/app/ApiServer/node_modules/whatwg-url/dist/url-state-machine.js:5:34)
        at Module._compile (internal/modules/cjs/loader.js:778:30)
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] start: `node index.js`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] start script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /root/.npm/_logs/2021-09-07T11_30_49_084Z-debug.log
    
    

    Solution helped for me:

    nano /app/MyProj/node_modules/whatwg-url/dist/encoding.js
    

    and just add new line:

    const { TextEncoder, TextDecoder } = require("util");
    
    opened by santiagz 9
  • Webpack build fails (react-scripts 0.9.5)

    Webpack build fails (react-scripts 0.9.5)

    When importing and using URL in an app created with create-react-app, building a production app fails with:

    > react-scripts build
    
    Creating an optimized production build...
    Failed to compile.
    
    static/js/main.38ef0137.js from UglifyJs
    SyntaxError: Name expected [./~/whatwg-url/lib/url-state-machine.js:6,0]
    
    opened by DawidLoubser 9
  • Punycode domains are not properly validated

    Punycode domains are not properly validated

    Start with the input:

    http://xn--ls8h/

    It works, as it should, and the result is the same. It's the poop emoji, in case you were wondering. It's in the WPT tests.

    Anyway, we can just start adding text to the end of this. For example:

    (Input) -> (JSDOM output)
    
    "http://xn--ls8h=/" -> "http://xn--js8hea/"
    "http://xn--ls8h==/" -> "http://xn--hs8hdh/"
    "http://xn--ls8h===/" -> "http://xn--gs8hcfj/"
    
    "http://xn--ls8h===helloworldhowareyoutoday/" -> "http://xn--gs8hcaceekclworldhowareyoutoday/"
                       ^^^^^^^^^^^^^^^^^^^^^^^^                              ^^^^^^^^^^^^^^^^^^^
    

    All of these inputs are invalid. Safari refuses to parse them, and my own IDNA implementation agrees. The tail part of the Punycode domain (after the xn--) should only consist of ASCII alphanumerics; having "=" signs in there (in the input) is clearly invalid.

    opened by karwa 1
  • Generalise file host parsing

    Generalise file host parsing

    This removes the file host state and parses file URL authorities using the generic authority state.

    The outward behaviour is unchanged and all tests are passing.

    One thing that might warrant another look is that the host parser can now return an empty host. Empty hosts are allowed in file URLs but not in other special URLs. This is now enforced elsewhere.

    There are checks in place that return failure if the URL is a file URL that has credentials or a port. There is some discussion about whether that should be changed in https://github.com/whatwg/url/issues/548 and https://github.com/whatwg/url/issues/97. This should help with whatever is decided there.

    opened by alwinb 0
  • What to do about validation errors

    What to do about validation errors

    The URL standard is getting more sophisticated about validation errors. See e.g. https://github.com/whatwg/url/issues/406.

    There is also the issue where the URL standard contains two different ways of checking URL validity, which are probably not equivalent; see some discussion in https://github.com/whatwg/url/issues/437#issuecomment-488022818. I'll call these "parser validity" and "writing validity", since the latter is derived from the URL writing section.

    It would be very neat if this package could provide:

    • Whether a URL is writing-valid. (At least for "absolute-URL-with-fragment string"; maybe relative URLs are out of scope.)
    • Whether a URL is parser-valid, including the name of any validation error(s) triggered during parsing.
    • Surface this information in the live URL viewer.
    • A test corpus of valid/invalid URLs, maybe drawn from urltestdata.json. We should at least have one parser-invalid URL for every named parser validation error, and it'd also be good to have writing-invalid URLs derived from systematically violating every rule in the writing URLs section.
    • Bonus: a fuzzer that generates strings and tests if they are parser-valid but writing-invalid, or parser-invalid but writing-valid.

    Right now we have some not-very-well-maintained code to track validation errors when the spec says to do so. It does this by setting urlStateMachine.parseError to true. ("parse error" is the old name for "validation error".) We'd probably want to update this to an array of strings (representing validation error names) that get pushed. And we should probably expose it on the URL record; that's #61. Or maybe elsewhere, since if you get a parsing failure, there's no URL record, so any fatal validation errors would be invisible this way?

    We have some known places where we miss validation errors that the spec asks about; I think most of them are due to not implementing "is a URL code point", which #59 tried to address, but got stalled.


    One reason why I was ambivalent about #59 is that it's a good bit of code, and potentially performance cost, for validity checking. At least one major consumer of this project, jsdom, prefers speed, and has no use for validity checking. It would also add memory consumption for every URL record, especially if as per the above we go beyond the simple boolean to instead be an array of strings.

    On the other hand, there aren't many other consumers of this project for "production" use. Everyone else should probably be using the built-in URL constructor in their environment (either Node or the browser). And we're not exactly tuned for speed anyway; there is probably lower-hanging fruit we're ignoring.

    We could address this in a number of ways, e.g.:

    • Take the code size hit, and benchmark the speed hit. (Probably after #155 gets us some basic benchmarks.) Maybe it's fine for jsdom's purposes.

    • Use source code rewriting to prune out validity-related parts of the parser code, so that we end up with two output .js files, e.g. url-state-machine-with-validy-checking.js and url-state-machine.js. (Related: #153, and maybe #155 because if we remove the p() source code rewriting then this would just be adding some back.) This would result in a larger npm package size but a smaller loaded-into-memory size.

    opened by domenic 0
  • No low-level access to parseError

    No low-level access to parseError

    As far as I can tell there's no low-level access to parseError. This makes it impossible to implement a simple validator on top of this code. (It would be even better for that to have detailed messages of course, but a boolean is a start.)

    opened by annevk 0
  • implement isURLCodePoint

    implement isURLCodePoint

    Perhaps you were waiting since it's not a pretty thing to have to implement. I'm doing it for my own purposes, so here's a version in what I think is your style if you want it.

    opened by cameronsteele 4
Releases(v12.0.0)
  • v12.0.0(Jan 3, 2023)

    Breaking change: removed Node.js v12 support.

    Changed the characters allowed in domains vs. generic hosts, per https://github.com/whatwg/url/commit/35e195a2cce7b82694284b8f60caeaf7b43087b4.

    Changed the URL API's search and hash setters, as well as the URLSearchParams API, to always ensure the URL is serialize-parse roundtrippable, per https://github.com/whatwg/url/commit/fdaa0e5a3790693a82f578d7373f216d8fef9ac8.

    Source code(tar.gz)
    Source code(zip)
  • v11.0.0(Oct 19, 2021)

    The breaking changes in this release are only to the Low-level URL Standard API. No actual URL parsing or serialization behavior has changed, and users of the URL and URLSearchParams exports are not affected.

    These changes follow https://github.com/whatwg/url/commit/fbaa03cb19ee5718953f5f6d179e0339e31f1ede.

    • Removed the URL record type's cannotBeABaseURL property.
    • Changed the URL record type's path from always being an array of strings, to being either a single string or an array of strings.
    • Renamed the "cannot-be-a-base-URL path" parser state (i.e. value for stateOverride) to "opaque path".
    • Added the serializePath(urlRecord) export.
    • Added the hasAnOpaquePath(urlRecord) export.
    Source code(tar.gz)
    Source code(zip)
  • v10.0.0(Oct 6, 2021)

    The breaking changes in this release are to the API exported by the whatwg-url/webidl2js-wrapper module. In particular it now is based on webidl2js v17, which changes some of the exported function signatures, and changes the realms of any errors thrown on misuse.

    Source code(tar.gz)
    Source code(zip)
  • v9.1.0(Aug 9, 2021)

    Made the host parser reject non-IPv4 domains that end in numbers, per https://github.com/whatwg/url/commit/ab0e820b0b559610b30c731b7f2c1a8094181680.

    Source code(tar.gz)
    Source code(zip)
  • v9.0.0(Jun 26, 2021)

    Breaking changes:

    • Removed Node.js v10 support.

    • The percentDecode() export was renamed percentDecodeBytes(), and now returns a Uint8Array instead of a Node.js Buffer.

    Other changes:

    • The package's main module now exports the percentDecodeString() helper.

    • The punycode and lodash dependencies were removed.

    Source code(tar.gz)
    Source code(zip)
  • v8.7.0(Jun 25, 2021)

    Make the pathname setter not mess up the URL's path state tracking when given the empty string, per https://github.com/whatwg/url/commit/0672f2e2ef43aca18b59d90abb6dac21712399bb.

    Source code(tar.gz)
    Source code(zip)
  • v8.6.0(Jun 8, 2021)

    Made the hostname setter do nothing if the given string contains a colon, per https://github.com/whatwg/url/commit/ec96993653a70d063843e0198694028c63348db4.

    Updated punycode processing to support Unicode v13.

    Source code(tar.gz)
    Source code(zip)
  • v8.5.0(Mar 24, 2021)

  • v8.4.0(Oct 8, 2020)

    Fixed file: URL parsing cases which would cause different results when serialized-then-reparsed, per https://github.com/whatwg/url/commit/a19495e27ad95154543b46f751d1a1bf25553808.

    Source code(tar.gz)
    Source code(zip)
  • v8.3.0(Sep 30, 2020)

  • v8.2.2(Sep 6, 2020)

  • v8.2.1(Sep 6, 2020)

  • v8.2.0(Aug 24, 2020)

    Made <, >, and ^ in the host component cause parsing failures, per https://github.com/whatwg/url/commit/302ba419cb3248568243aaf7b5aca9003694d5c3.

    Fixed the parsing-then-serializing of non-special URLs to be idempotent, per https://github.com/whatwg/url/commit/83adf0c9ca9a88948e1e5d93374ffded04eec727.

    Source code(tar.gz)
    Source code(zip)
  • v8.1.0(May 8, 2020)

    Changed fragment parsing so that U+0000 code points are now percent-encoded, instead of removed, per https://github.com/whatwg/url/commit/3d574017081f6594ce1fa7a5107027c83dbe931f.

    Changed file: URL parsing so that if the host ends up empty after the Unicode ToASCII operation, it now result in parsing failure, per https://github.com/whatwg/url/commit/cceb4356cca233b6dfdaabd888263157b2204e44.

    Source code(tar.gz)
    Source code(zip)
  • v8.0.0(Jan 2, 2020)

    The breaking change in this release is raising the minimum Node.js version to v10.

    This release introduces the whatwg-url/webidl2js-wrapper module, which can be used to install URL and URLSearchParams constructors on arbitrary global objects. (This is useful for jsdom, after jsdom/[email protected]). Consumers of the default whatwg-url module are not affected.

    Source code(tar.gz)
    Source code(zip)
  • v7.1.0(Oct 21, 2019)

    Removed gopher: special-case parsing and origin computation, per https://github.com/whatwg/url/commit/d589670451a4da9717bad69ed5d5364f93fede33 and https://github.com/whatwg/url/commit/7ae1c691c96f0d82fafa24c33aa1e8df9ffbf2bc.

    Source code(tar.gz)
    Source code(zip)
  • v7.0.0(Aug 18, 2018)

    Changed file: URLs to have an opaque origin, which serializes to "null". Previously all file: URLs shared an origin serialization of "file://". This is underspecified, so either behavior is technically correct, but opaque origins is the more conservative choice.

    Improved error messages for invalid input URLs to include those input strings.

    Upgraded our webidl2js built-time code-generation dependency from 7.4.x to 9.x; see that package's changelog for details.

    Source code(tar.gz)
    Source code(zip)
  • v6.5.0(Jun 8, 2018)

    Percent-encoded ' characters in the query portion of URLs with special schemes, per https://github.com/whatwg/url/commit/6ef17ebe1220a7e7c0cfff0785017502ee18808b.

    Source code(tar.gz)
    Source code(zip)
  • v6.4.1(Apr 22, 2018)

  • v6.4.0(Dec 5, 2017)

    Changed percent-escaping rules in the query portion of URLs, per https://github.com/whatwg/url/commit/7a3c69f8a1583b33e730c3fea85141a618e7c697.

    Source code(tar.gz)
    Source code(zip)
  • v6.3.0(Sep 25, 2017)

    Fixed Windows drive letter handling when resolving relative to another Windows-drive-letter-containing URL, per https://github.com/whatwg/url/commit/2eef975e989cb5ae2d62467394778fd6778ddec9.

    Source code(tar.gz)
    Source code(zip)
  • v6.2.1(Sep 25, 2017)

  • v6.2.0(Sep 25, 2017)

    Fixed URLSearchParams to remove the "?" from its parent URL if the query becomes empty, per https://github.com/whatwg/url/commit/43158268deb10343057998b8d761a193e9f3dc8a.

    Source code(tar.gz)
    Source code(zip)
  • v6.1.0(Jun 30, 2017)

    Made the scheme setter properly reset the port as appropriate, per https://github.com/whatwg/url/commit/0f53958338bbaec3882f902897873da59ba7e8bd.

    Source code(tar.gz)
    Source code(zip)
  • v6.0.1(Jun 29, 2017)

  • v6.0.0(Jun 29, 2017)

    Node.js v6 is now required, as we have started using JavaScript language features not present in earlier versions.

    Added spec-compliant URLSearchParams support, both as an export and through the searchParams property of URL instances. (@TimothyGu)

    Added the percentDecode function to the public API.

    Added the cannotHaveAUsernamePasswordPort function to the public API. It was previously documented in the README, but accidentally not exported.

    Changed the return value representing failure from the string "failure" to null.

    Upgraded our webidl2js and webidl-conversions dependencies, bringing along various edge-case features and fixes, such as a proper Symbol.toStringTag on URL instances and better error messages.

    Source code(tar.gz)
    Source code(zip)
  • v5.0.0(May 26, 2017)

    Changed origin serialization to be the ASCII serialization of the origin, instead of the now-no-longer-a-thing Unicode serialization, per https://github.com/whatwg/url/commit/20c3257194db218c47526ba4ef4894a09e3847c9.

    This changed the public API by removing serializeURLToUnicodeOrigin and instead exporting serializeURLOrigin.

    Source code(tar.gz)
    Source code(zip)
  • v4.8.0(May 10, 2017)

    Fixed Windows drive letter handling with a file: base URL, per https://github.com/whatwg/url/commit/fe6b251739e225555f04319f19c70c031a5d99eb.

    Source code(tar.gz)
    Source code(zip)
  • v4.7.1(Apr 24, 2017)

  • v4.7.0(Apr 3, 2017)

    Changed file URLs to trim leading slashes from their paths, per https://github.com/whatwg/url/commit/6103e0a58eb2460d409056fb2b93b015941b64f2.

    Source code(tar.gz)
    Source code(zip)
RCD: Relation Map Driven Cognitive Diagnosis for Intelligent Education Systems

RCD: Relation Map Driven Cognitive Diagnosis for Intelligent Education Systems This is our implementation for the paper: Weibo Gao, Qi Liu*, Zhenya Hu

BigData Lab @USTC 中科大大数据实验室 10 Oct 16, 2022
Official Repository for Machine Learning class - Physics Without Frontiers 2021

PWF 2021 Física Sin Fronteras es un proyecto del Centro Internacional de Física Teórica (ICTP) en Trieste Italia. El ICTP es un centro dedicado a fome

36 Aug 06, 2022
The Python ensemble sampling toolkit for affine-invariant MCMC

emcee The Python ensemble sampling toolkit for affine-invariant MCMC emcee is a stable, well tested Python implementation of the affine-invariant ense

Dan Foreman-Mackey 1.3k Dec 31, 2022
Realtime Face Anti Spoofing with Face Detector based on Deep Learning using Tensorflow/Keras and OpenCV

Realtime Face Anti-Spoofing Detection 🤖 Realtime Face Anti Spoofing Detection with Face Detector to detect real and fake faces Please star this repo

Prem Kumar 86 Aug 03, 2022
Feed forward VQGAN-CLIP model, where the goal is to eliminate the need for optimizing the latent space of VQGAN for each input prompt

Feed forward VQGAN-CLIP model, where the goal is to eliminate the need for optimizing the latent space of VQGAN for each input prompt. This is done by

Mehdi Cherti 135 Dec 30, 2022
Development kit for MIT Scene Parsing Benchmark

Development Kit for MIT Scene Parsing Benchmark [NEW!] Our PyTorch implementation is released in the following repository: https://github.com/hangzhao

MIT CSAIL Computer Vision 424 Dec 01, 2022
This repository contains the scripts for downloading and validating scripts for the documents

HC4: HLTCOE CLIR Common-Crawl Collection This repository contains the scripts for downloading and validating scripts for the documents. Document ids,

JHU Human Language Technology Center of Excellence 6 Jun 07, 2022
A Kitti Road Segmentation model implemented in tensorflow.

KittiSeg KittiSeg performs segmentation of roads by utilizing an FCN based model. The model achieved first place on the Kitti Road Detection Benchmark

Marvin Teichmann 890 Jan 04, 2023
Evaluating different engineering tricks that make RL work

Reinforcement Learning Tricks, Index This repository contains the code for the paper "Distilling Reinforcement Learning Tricks for Video Games". Short

Anssi 15 Dec 26, 2022
End-to-end beat and downbeat tracking in the time domain.

WaveBeat End-to-end beat and downbeat tracking in the time domain. | Paper | Code | Video | Slides | Setup First clone the repo. git clone https://git

Christian J. Steinmetz 60 Dec 24, 2022
TensorFlow for Raspberry Pi

TensorFlow on Raspberry Pi It's officially supported! As of TensorFlow 1.9, Python wheels for TensorFlow are being officially supported. As such, this

Sam Abrahams 2.2k Dec 16, 2022
K Closest Points and Maximum Clique Pruning for Efficient and Effective 3D Laser Scan Matching (To appear in RA-L 2022)

KCP The official implementation of KCP: k Closest Points and Maximum Clique Pruning for Efficient and Effective 3D Laser Scan Matching, accepted for p

Yu-Kai Lin 109 Dec 14, 2022
PFLD pytorch Implementation

PFLD-pytorch Implementation of PFLD A Practical Facial Landmark Detector by pytorch. 1. install requirements pip3 install -r requirements.txt 2. Datas

zhaozhichao 669 Jan 02, 2023
HMLET (Hybrid-Method-of-Linear-and-non-linEar-collaborative-filTering-method)

Methods HMLET (Hybrid-Method-of-Linear-and-non-linEar-collaborative-filTering-method) Dynamically selecting the best propagation method for each node

Yong 7 Dec 18, 2022
classify fashion-mnist dataset with pytorch

Fashion-Mnist Classifier with PyTorch Inference 1- clone this repository: git clone https://github.com/Jhamed7/Fashion-Mnist-Classifier.git 2- Instal

1 Jan 14, 2022
Wordle-solver - Wordle answer generation program in python

🟨 Wordle Solver 🟩 Wordle answer generation program in python ✔️ Requirements U

Dahyun Kang 4 May 28, 2022
Fight Recognition from Still Images in the Wild @ WACVW2022, Real-world Surveillance Workshop

Fight Detection from Still Images in the Wild Detecting fights from still images is an important task required to limit the distribution of social med

Şeymanur Aktı 10 Nov 09, 2022
Attention mechanism with MNIST dataset

[TensorFlow] Attention mechanism with MNIST dataset Usage $ python run.py Result Training Loss graph. Test Each figure shows input digit, attention ma

YeongHyeon Park 12 Jun 10, 2022
Prompt Tuning with Rules

PTR Code and datasets for our paper "PTR: Prompt Tuning with Rules for Text Classification" If you use the code, please cite the following paper: @art

THUNLP 118 Dec 30, 2022
Introducing neural networks to predict stock prices

IntroNeuralNetworks in Python: A Template Project IntroNeuralNetworks is a project that introduces neural networks and illustrates an example of how o

Vivek Palaniappan 637 Jan 04, 2023