Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix darknet classifier, refactor preprocessing #1398

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a05fcfe
Separate the code in ImageClassifier for loading a model from a URL i…
lindapaiste Apr 24, 2022
bdd0517
Upgrade webpack and eslint packages to the latest versions.
lindapaiste May 8, 2022
4029df9
Remove unused packages
lindapaiste May 8, 2022
e51684d
Merge branch 'main' into update/webpack-eslint
lindapaiste May 8, 2022
4a15a44
Merge remote-tracking branch 'upstream/main' into update/webpack-eslint
lindapaiste May 8, 2022
0eff7c8
Regenerate package-lock.json after merge
lindapaiste May 8, 2022
18769cd
fix error importing ImageData polyfill
lindapaiste May 8, 2022
ccaaf1f
Merge branch 'main' into fix/image-classifier-from-url
lindapaiste May 13, 2022
ba64f3d
deprecation warning
lindapaiste May 13, 2022
6c378ee
deprecation warning, fix darknet version
lindapaiste May 13, 2022
e205d32
Merge remote-tracking branch 'origin/fix/image-classifier-from-url' i…
lindapaiste May 13, 2022
70776c3
fix darknet version
lindapaiste May 13, 2022
ac2b145
Cleanup/rewrite DCGAN and CVAE. Move some common logic to new util te…
lindapaiste May 15, 2022
06e6196
Merge branch 'main' into update/webpack-eslint
lindapaiste May 15, 2022
6ecdf66
Allow TypeScript files alongside Javascript
lindapaiste May 15, 2022
f51a518
Merge remote-tracking branch 'upstream/main' into fix/image-classifie…
lindapaiste May 22, 2022
8a8032c
Merge remote-tracking branch 'upstream/main' into fix/image-classifie…
lindapaiste May 22, 2022
9bac2c8
use modelLoader in CustomImageClassifier
lindapaiste May 22, 2022
fca60fe
Merge branch 'main' into feat/ts-support
lindapaiste May 22, 2022
6ef3f40
make calls to tf.browser.fromPixels conditional to support tensors as…
lindapaiste May 22, 2022
5d299cc
Merge remote-tracking branch 'origin/fix/image-classifier-from-url' i…
lindapaiste May 24, 2022
5add701
Merge branch 'feat/ts-support' into fix/to-tensor
lindapaiste May 24, 2022
aff467b
Merge remote-tracking branch 'origin/cleanup/dcgan-cvae' into fix/to-…
lindapaiste May 25, 2022
b4960e9
fix incorrect darknet predictions due to preprocessing
lindapaiste May 26, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
dist
dist_examples
**/lib
.eslintrc.js

19 changes: 18 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,30 @@ const p5Globals = require("./p5Globals");
const p5SoundGlobals = require("./p5SoundGlobals");

module.exports = {
extends: ["airbnb-base", "prettier"],
extends: [
"airbnb-base",
"airbnb-typescript/base",
"prettier"
],
parserOptions: {
project: "./tsconfig.json"
},
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "import"],
globals: {
fetch: false,
document: true,
},
rules: {
"no-console": 0,
"arrow-body-style": 0,
"import/no-useless-path-segments": 0,
"no-constructor-return": 0,
"no-else-return": 0,
"@typescript-eslint/default-param-last": 0,
"prefer-regex-literals": 0,
"prefer-object-spread": 0,
"@typescript-eslint/lines-between-class-members": 0
},
env: {
browser: true,
Expand Down
8 changes: 6 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* https://jestjs.io/docs/configuration
*/

/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
testTimeout: 100000,
// All imported modules in your tests should be mocked automatically
Expand Down Expand Up @@ -86,7 +87,7 @@ module.exports = {
passWithNoTests: true,

// A preset that is used as a base for Jest's configuration
// preset: undefined,
preset: 'ts-jest',

// Run tests from one or more projects
// projects: undefined,
Expand Down Expand Up @@ -169,7 +170,10 @@ module.exports = {
// timers: "real",

// A map from regular expressions to paths to transformers
// transform: undefined,
transform: {
"^.+\\.(ts|tsx)?$": "ts-jest",
"^.+\\.(js|jsx)$": "babel-jest",
}

// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
// transformIgnorePatterns: [
Expand Down
33 changes: 3 additions & 30 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const path = require("path");
const webpackConfig = require("./webpack.common.babel");

module.exports = config => {
config.set({
Expand All @@ -20,38 +20,11 @@ module.exports = config => {
"src/utils/*.js": ["webpack"],
},
webpack: {
// TODO: This is duplication of the webpack.common.babel.js file, but they
// use different import syntaxes so it's not easy to just require it here.
// Maybe this could be put into a JSON file, but the include in the module
// rules is dynamic.
entry: ["@babel/polyfill", "./src/index.js"],
output: {
libraryTarget: "umd",
filename: "ml5.js",
library: "ml5",
},
module: {
rules: [
{
enforce: "pre",
test: /\.js$/,
exclude: /node_modules/,
loader: "eslint-loader",
},
{
test: /\.js$/,
loader: "babel-loader",
include: path.resolve(__dirname, "src"),
},
],
},
...webpackConfig,
// Don't minify the webpack build for better stack traces
optimization: {
minimize: false,
},
node: {
fs: "empty",
},
}
},
webpackMiddleware: {
noInfo: true,
Expand Down
Loading