Code Monkey home page Code Monkey logo

encord-team / encord-active Goto Github PK

View Code? Open in Web Editor NEW
420.0 10.0 23.0 270.51 MB

The toolkit to test, validate, and evaluate your models and surface, curate, and prioritize the most valuable data for labeling.

Home Page: https://encord.com/active

License: Apache License 2.0

HTML 0.03% JavaScript 0.06% TypeScript 16.73% CSS 0.06% Python 82.95% Dockerfile 0.12% Mako 0.04%
computer-vision data data-science data-validation deep-learning machine-learning ml mlops python active-learning

encord-active's Introduction

Documentation | Try it Now | Website | Blog | Join our Community

Encord logo

❓ What is Encord Active?

Encord Active is an open-source toolkit to test, validate, and evaluate your models and surface, curate, and prioritize the most valuable data for labeling to supercharge model performance.

Use Encord Active to:

  • Test, validate, and evaluate your models with advanced error analysis
  • Generate model explainability reports
  • Surface, curate, and prioritize the most valuable data for labeling
  • Search through your data using natural language (beta feature)
  • Find and fix dataset errors and biases (duplicates, outliers, label errors)

homepage-visual

Installation

The simplest way to install the CLI is using pip in a suitable virtual environment:

pip install encord-active

We recommend using a virtual environment, such as venv:

python3.9 -m venv ea-venv
source ea-venv/bin/activate
pip install encord-active

encord-active requires python3.9. If you have trouble installing encord-active, you find more detailed instructions on installing it here. If just want to see it in action try out this Colab notebook.

👋 Quickstart

Get started immediately by sourcing your environment and running the code below. This downloads a small dataset and launches the Encord Active App for you to explore:

encord-active quickstart

or you can use :

docker run -it --rm -p 8000:8000 -v ${PWD}:/data encord/encord-active quickstart

After opening the UI, we recommend you to head to the workflow documentation to see some common workflows.

projects page

💡 When to use Encord Active?

Encord Active helps you understand and improve your data, labels, and models at all stages of your computer vision journey.

Whether you've just started collecting data, labeled your first batch of samples, or have multiple models in production, Encord Active can help you.

encord active diagram

🚀 Encord Active Versions

Encord Active (EA) is available in two versions:

  • Encord Active Cloud 🌥️
  • Encord Active OS 💻

Active Cloud is tightly integrated with Encord Annotate, with Active Cloud and Annotate being hosted by Encord--you can signup and start using Active without installing anything.

Or self-host and start using the open source toolkit locally ⬇️.

🔖 Documentation

Our full documentation is available here. In particular, we recommend checking out:

⬇️ Download a sandbox dataset

Another way to quickly get familiar with Encord Active is to download a dataset from its sandbox. The download command will ask which pre-built dataset to use and will download it into a new directory in the current working directory.

encord-active download
cd /path/of/downloaded/project
encord-active start

The app should then open in the browser. If not, navigate to localhost:8000. Our docs contain more information about what you can see in the page.

Import your dataset

Quick import Dataset

To import your data (without labels) save your data in a directory and run the command:

# within venv
encord-active init /path/to/data/directory

A project will be created using the data in the directory.

To start the project run:

cd /path/to/project
encord-active start

You can find more details on the init command in the documentation.

Import from COCO

To import your data, labels, and predictions from COCO, save your data in a directory and run the command:

# install COCO extras
(ea-venv)$ python -m pip install encord-active[coco]

# import samples with COCO annotations
encord-active import project --coco -i ./images -a ./annotations.json

# import COCO model predictions
encord-active import predictions --coco results.json

Import from the Encord platform

This section requires setting up an ssh key with Encord, so slightly more technical.

To import an Encord project, use this command:

encord-active import project

The command will allow you to search through your Encord projects and choose which one to import.

⭐ Concepts and features

Quality metrics:

Quality metrics are applied to your data, labels, and predictions to assign them quality metric scores. Plug in your own or rely on Encord Active's prebuilt quality metrics. The quality metrics automatically decompose your data, label, and model quality to show you how to improve your model performance from a data-centric perspective. Encord Active ships with 25+ metrics and more are coming; contributions are also very welcome.

Core features:

Visit our documentation to learn more.

Supported data:

Data Types Labels Project sizes
jpg Bounding Boxes Images 25.000
png Polygons Videos * 25.000 frames
tiff Segmentations
mp4 * Classifications
Polylines 🟡

* Requires an Encord Annotate account

Active Cloud 🌩️

Don't want to host Encord Active on your server? Or are you loading >25k images for your project? Check out Active Cloud extending features from Encord Active open source to help you:

✅ Curate datasets better with Collections
✅ Evaluate models with in-built and custom metrics
✅ Perform Natural Language Search
✅ Search your dataset by images
✅ Integrate with annotation platform
✅ Filter by metadata

active-cloud

Try it for free

🧑🏽‍💻Development

🛠 Build your own quality metrics

Encord Active is built with customizability in mind. Therefore, you can easily build your own custom metrics 🔧. See the Writing Your Own Metric page in the docs for details on this topic.

If you need help or guidance feel free to ping us in our Slack workspace!

👪 Community and support

Join our community on Slack to connect with the team behind Encord Active. Also, feel free to suggest improvements or report problems via GitHub issues.

🎇 Contributions

If you're using Encord Active in your organization, please try to add your company name to the ADOPTERS.md. It really helps the project to gain momentum and credibility. It's a small contribution back to the project with a big impact.

If you want to share your custom metrics or improve the tool, please see our contributing docs.

🦸 Contributors

Contributors graph

@Javi Leguina

Licence

This repository is published under the Apache 2.0 licence.

encord-active's People

Contributors

alex-encord avatar ali-encord avatar david-babuschkin-encord avatar dependabot[bot] avatar eloy-encord avatar encord-davids avatar eric-encord avatar frederik-encord avatar gorkem-encord avatar james-encord avatar nikolaj-encord avatar stephen-encord avatar yogesh-encord avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

encord-active's Issues

DLL load failed when importing faiss package downloaded via pip in windows

Current Faiss package works unofficially in Mac and Linux but fails to load in Windows. Seems that we have to explore build the package from source or to add its DLL path to PATH for Windows (if is possible).
References:
https://stackoverflow.com/questions/65338966/windows-import-faiss-errordll-load-failed
https://github.com/facebookresearch/faiss/blob/main/INSTALL.md
https://github.com/bitsun/faiss-windows/blob/master/INSTALL.md

Properly calculate chart sizes

Charts are in weird sizes since we have to use absolute, non-responsive, sizes.

A possible solution is to use a ghost element on the main container and get its width. The width can be used to get the correct size for full-width charts and for nested ones.

e.g. here

feat: Argument for custom port in visualization

Is your feature request related to a problem? Please describe.

I saw that port is hardcoded by default. Sometimes this port is already taken, and you have to change it in site packages, which is quite annoying.

Describe the solution you'd like to see

Maybe adding optional argument for port would slove this problem?

Describe alternate solutions

Additional information

No response

bug: encord-active start error

Provide environment information

System Information:
System: Linux
Release: 4.14.0_1-0-0-50
Machine: x86_64
Processor: x86_64
Python: 3.10.13 (main, Sep 11 2023, 13:44:35) [GCC 11.2.0]

CPU Info:
Physical cores: 40
Total cores: 80
Total CPU Usage: 35.4%

Memory Information:
Total: 502.69GB
Available: 181.58GB
Used: 291.29GB

Describe the bug

I have import my coco project, and the process is correct. But when I start my project, an error may occur. The error is as following.

/root/anaconda3/envs/encord/lib/python3.10/site-packages/encord_active/db/scripts/migrate_disk_t │
│ o_db.py:172 in _assign_metrics │
│ │
│ 169 │ │ │
│ 170 │ │ metrics_dict[metric_column_name] = score │
│ 171 │ elif metric_column_name not in metrics_derived: │
│ ❱ 172 │ │ raise ValueError( │
│ 173 │ │ │ f"Duplicate metric assignment for, column={metric_column_name}," f"identifie │
│ 174 │ │ ) │
│ 175 │ else: │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ description = 'Possible duplicates' │ │
│ │ description_dict = ({}, {'metric_label_duplicates': 'Possible duplicates'}) │ │
│ │ error_identifier = '92d97e68-1677-468f-b52d-9af4bd5815ad_2cb51c6d-82ad-4973-b157-3472528b… │ │
│ │ metric_column_name = 'metric_label_duplicates' │ │
│ │ metric_types = { │ │
│ │ │ 'metric_width': MetricDefinition( │ │
│ │ │ │ title='Width', │ │
│ │ │ │ short_desc='Width in pixels', │ │
│ │ │ │ long_desc='', │ │
│ │ │ │ type=<MetricType.UINT: 'uint'> │ │
│ │ │ ), │ │
│ │ │ 'metric_height': MetricDefinition( │ │
│ │ │ │ title='Height', │ │
│ │ │ │ short_desc='Height in pixels', │ │
│ │ │ │ long_desc='', │ │
│ │ │ │ type=<MetricType.UINT: 'uint'> │ │
│ │ │ ), │ │
│ │ │ 'metric_area': MetricDefinition( │ │
│ │ │ │ title='Area', │ │
│ │ │ │ short_desc='Area in pixels', │ │
│ │ │ │ long_desc='', │ │
│ │ │ │ type=<MetricType.UINT: 'uint'> │ │
│ │ │ ), │ │
│ │ │ 'metric_aspect_ratio': MetricDefinition( │ │
│ │ │ │ title='Aspect Ratio', │ │
│ │ │ │ short_desc='Aspect ratio = (Width / Height)', │ │
│ │ │ │ long_desc='', │ │
│ │ │ │ type=<MetricType.UFLOAT: 'ufloat'> │ │
│ │ │ ), │ │
│ │ │ 'metric_brightness': MetricDefinition( │ │
│ │ │ │ title='Brightness', │ │
│ │ │ │ short_desc='Brightness of the image data', │ │
│ │ │ │ long_desc='', │ │
│ │ │ │ type=<MetricType.NORMAL: 'normal'> │ │
│ │ │ ), │ │
│ │ │ 'metric_contrast': MetricDefinition( │ │
│ │ │ │ title='Contrast', │ │
│ │ │ │ short_desc='Contrast of the image data', │ │
│ │ │ │ long_desc='', │ │
│ │ │ │ type=<MetricType.NORMAL: 'normal'> │ │
│ │ │ ), │ │
│ │ │ 'metric_sharpness': MetricDefinition( │ │
│ │ │ │ title='Sharpness', │ │
│ │ │ │ short_desc='', │ │
│ │ │ │ long_desc='', │ │
│ │ │ │ type=<MetricType.NORMAL: 'normal'> │ │
│ │ │ ), │ │
│ │ │ 'metric_red': MetricDefinition( │ │
│ │ │ │ title='Red', │ │
│ │ │ │ short_desc='Redness of the image data', │ │
│ │ │ │ long_desc='', │ │
│ │ │ │ type=<MetricType.NORMAL: 'normal'> │ │
│ │ │ ), │ │
│ │ │ 'metric_green': MetricDefinition( │ │
│ │ │ │ title='Green', │ │
│ │ │ │ short_desc='Greenness of the image data', │ │
│ │ │ │ long_desc='', │ │
│ │ │ │ type=<MetricType.NORMAL: 'normal'> │ │
│ │ │ ), │ │
│ │ │ 'metric_blue': MetricDefinition( │ │
│ │ │ │ title='Blue', │ │
│ │ │ │ short_desc='Blueness of the image data', │ │
│ │ │ │ long_desc='', │ │
│ │ │ │ type=<MetricType.NORMAL: 'normal'> │ │
│ │ │ ), │ │
│ │ │ ... +10 │ │
│ │ } │ │
│ │ metrics_derived = set() │ │
│ │ metrics_dict = { │ │
│ │ │ 'feature_hash': 'c25f8b8b', │ │
│ │ │ 'annotation_type': <AnnotationType.BOUNDING_BOX: 'bounding_box'>, │ │
│ │ │ 'annotation_email': '[email protected]', │ │
│ │ │ 'annotation_manual': False, │ │
│ │ │ 'metric_label_confidence': 1.0, │ │
│ │ │ 'metric_label_duplicates': 0.7081959106059806 │ │
│ │ } │ │
│ │ score = 0.808920385862211 │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: Duplicate metric assignment for, column=metric_label_duplicates,identifier=92d97e68-1677-468f-b52d-9af4bd5815ad_2cb51c6d-82ad-4973-b157-3472528b6749_00000_ffed7d4d_038e8d70

To reproduce

I have try another projects, not all projects is eroor. Some are right but some are wrong.

Additional information

No response

bug: Sandbox project fails with `OperationalError` when connecting to database on Ubuntu 20.04 in v0.1.77

Provide environment information

System Information:
System: Linux
Release: 5.10.16.3-microsoft-standard-WSL2
Machine: x86_64
Processor: x86_64
Python: 3.9.16 (main, Mar 10 2023, 15:28:53)
[GCC 9.4.0]

CPU Info:
Physical cores: 8
Total cores: 16
Total CPU Usage: 7.9%

Memory Information:
Total: 15.54GB
Available: 8.26GB
Used: 6.60GB

Describe the bug

Hi team,

I'm encountering issues downloading a sandbox project locally with EA 0.1.77 from cleaning this notebook.

Expected Behavior:

Launch the Encord Active app with the sandbox project included.

Actual Behavior:

Here is the output:

{
	"name": "OperationalError",
	"message": "(sqlite3.OperationalError) near \"DROP\": syntax error
[SQL: ALTER TABLE active_project_analytics_data DROP COLUMN metric_annotation_quality]
(Background on this error at: https://sqlalche.me/e/14/e3q8)",
	"stack": "---------------------------------------------------------------------------
OperationalError                          Traceback (most recent call last)
File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/sqlalchemy/engine/base.py:1900, in Connection._execute_context(self, dialect, constructor, statement, parameters, execution_options, *args, **kw)
   1899     if not evt_handled:
-> 1900         self.dialect.do_execute(
   1901             cursor, statement, parameters, context
   1902         )
   1904 if self._has_events or self.engine._has_events:

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/sqlalchemy/engine/default.py:736, in DefaultDialect.do_execute(self, cursor, statement, parameters, context)
    735 def do_execute(self, cursor, statement, parameters, context=None):
--> 736     cursor.execute(statement, parameters)

OperationalError: near \"DROP\": syntax error

The above exception was the direct cause of the following exception:

OperationalError                          Traceback (most recent call last)
/home/stephen/encord/encord-notebooks/notebooks/01_Encord_Active_Notebooks___Download_sandbox_project.ipynb Cell 17 line 5
      <a href='vscode-notebook-cell://wsl%2Bubuntu-20.04/home/stephen/encord/encord-notebooks/notebooks/01_Encord_Active_Notebooks___Download_sandbox_project.ipynb#X22sdnNjb2RlLXJlbW90ZQ%3D%3D?line=1'>2</a> project_path = Path.cwd() / project_name
      <a href='vscode-notebook-cell://wsl%2Bubuntu-20.04/home/stephen/encord/encord-notebooks/notebooks/01_Encord_Active_Notebooks___Download_sandbox_project.ipynb#X22sdnNjb2RlLXJlbW90ZQ%3D%3D?line=3'>4</a> # Download the dataset
----> <a href='vscode-notebook-cell://wsl%2Bubuntu-20.04/home/stephen/encord/encord-notebooks/notebooks/01_Encord_Active_Notebooks___Download_sandbox_project.ipynb#X22sdnNjb2RlLXJlbW90ZQ%3D%3D?line=4'>5</a> fetch_prebuilt_project(project_name, project_path)

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/encord_active/lib/project/sandbox_projects/sandbox_projects.py:199, in fetch_prebuilt_project(project_name, out_dir, unpack, progress_callback)
    196     return output_file_path
    198 unpacked_archive_path = unpack_archive(output_file_path, out_dir)
--> 199 ensure_safe_project(unpacked_archive_path)
    200 return unpacked_archive_path

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/encord_active/cli/utils/server.py:31, in ensure_safe_project(root_path, final_data_version)
     29 ensure_initialised_merged_metrics(project_file_structure)
     30 ensure_prisma_db(project_file_structure.prisma_db)
---> 31 run_data_migrations(project_file_structure, final_data_version=final_data_version)

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/encord_active/lib/db/data/run_data_migrations.py:44, in run_data_migrations(pfs, final_data_version)
     42         sys.modules[\"module.name\"] = migration
     43         spec.loader.exec_module(migration)
---> 44         migration.up(pfs)
     46 # This can be conditionally disabled for ease of debugging variations in the project version.
     47 if os.environ.get(\"ENCORD_ACTIVE_DEBUGGING_DISABLE_MIGRATION_TIMESTAMPS\", \"0\") != \"1\":

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/encord_active/lib/db/data/migrations/202306141900_fill_global_db.py:34, in up(pfs)
     32         batch.commit()
     33 # Run database migration script
---> 34 migrate_disk_to_db(pfs)

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/encord_active/db/scripts/migrate_disk_to_db.py:1225, in migrate_disk_to_db(pfs, delete_existing_project)
   1213 metrics_db_data_extra = [
   1214     ProjectDataAnalyticsExtra(
   1215         project_hash=project_hash,
   (...)
   1221     for (du_hash, frame), (embeddings, metric_metadata) in data_metric_extra.items()
   1222 ]
   1224 path = database_dir / \"encord-active.sqlite\"
-> 1225 engine = get_engine(path)
   1226 if delete_existing_project:
   1227     delete_project_from_db(engine, project_hash)

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/encord_active/db/models.py:611, in get_engine(path, concurrent, use_alembic)
    608     os.chdir(alembic_cwd)
    609     import alembic.config
--> 611     alembic.config.main(argv=alembic_args[1:])
    612 finally:
    613     os.chdir(current_cwd)

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/alembic/config.py:630, in main(argv, prog, **kwargs)
    627 def main(argv=None, prog=None, **kwargs):
    628     \"\"\"The console runner function for Alembic.\"\"\"
--> 630     CommandLine(prog=prog).main(argv=argv)

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/alembic/config.py:624, in CommandLine.main(self, argv)
    618 else:
    619     cfg = Config(
    620         file_=options.config,
    621         ini_section=options.name,
    622         cmd_opts=options,
    623     )
--> 624     self.run_cmd(cfg, options)

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/alembic/config.py:601, in CommandLine.run_cmd(self, config, options)
    598 fn, positional, kwarg = options.cmd
    600 try:
--> 601     fn(
    602         config,
    603         *[getattr(options, k, None) for k in positional],
    604         **{k: getattr(options, k, None) for k in kwarg},
    605     )
    606 except util.CommandError as e:
    607     if options.raiseerr:

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/alembic/command.py:382, in upgrade(config, revision, sql, tag)
    371     return script._upgrade_revs(revision, rev)
    373 with EnvironmentContext(
    374     config,
    375     script,
   (...)
    380     tag=tag,
    381 ):
--> 382     script.run_env()

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/alembic/script/base.py:578, in ScriptDirectory.run_env(self)
    569 def run_env(self) -> None:
    570     \"\"\"Run the script environment.
    571 
    572     This basically runs the ``env.py`` script present
   (...)
    576 
    577     \"\"\"
--> 578     util.load_python_file(self.dir, \"env.py\")

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/alembic/util/pyfiles.py:93, in load_python_file(dir_, filename)
     91 if ext == \".py\":
     92     if os.path.exists(path):
---> 93         module = load_module_py(module_id, path)
     94     else:
     95         pyc_path = pyc_file_from_path(path)

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/alembic/util/pyfiles.py:109, in load_module_py(module_id, path)
    107 assert spec
    108 module = importlib.util.module_from_spec(spec)
--> 109 spec.loader.exec_module(module)  # type: ignore
    110 return module

File <frozen importlib._bootstrap_external>:850, in exec_module(self, module)

File <frozen importlib._bootstrap>:228, in _call_with_frames_removed(f, *args, **kwds)

File migrations/env.py:91

File migrations/env.py:85, in run_migrations_online()

File <string>:8, in run_migrations(*args, **kw)

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/alembic/runtime/environment.py:922, in EnvironmentContext.run_migrations(self, **kw)
    920 assert self._migration_context is not None
    921 with Operations.context(self._migration_context):
--> 922     self.get_context().run_migrations(**kw)

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/alembic/runtime/migration.py:624, in MigrationContext.run_migrations(self, **kw)
    620 if self.as_sql:
    621     self.impl.static_output(
    622         \"-- Running %s\" % (step.short_log,)
    623     )
--> 624 step.migration_fn(**kw)
    626 # previously, we wouldn't stamp per migration
    627 # if we were in a transaction, however given the more
    628 # complex model that involves any number of inserts
    629 # and row-targeted updates and deletes, it's simpler for now
    630 # just to run the operations on every version
    631 head_maintainer.update_to_step(step)

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/encord_active/db/migrations/versions/bcfdfc2f498a_init2.py:23, in upgrade()
     18 def upgrade() -> None:
     19     # ### commands auto generated by Alembic - please adjust! ###
     20     op.drop_index(
     21         \"active_data_project_hash_metric_annotation_quality_index\", table_name=\"active_project_analytics_data\"
     22     )
---> 23     op.drop_column(\"active_project_analytics_data\", \"metric_annotation_quality\")

File <string>:8, in drop_column(*args, **kw)

File <string>:3, in drop_column(self, table_name, column_name, schema, **kw)

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/alembic/operations/ops.py:2271, in DropColumnOp.drop_column(cls, operations, table_name, column_name, schema, **kw)
   2233 \"\"\"Issue a \"drop column\" instruction using the current
   2234 migration context.
   2235 
   (...)
   2267 
   2268 \"\"\"
   2270 op = cls(table_name, column_name, schema=schema, **kw)
-> 2271 return operations.invoke(op)

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/alembic/operations/base.py:393, in AbstractOperations.invoke(self, operation)
    386 \"\"\"Given a :class:`.MigrateOperation`, invoke it in terms of
    387 this :class:`.Operations` instance.
    388 
    389 \"\"\"
    390 fn = self._to_impl.dispatch(
    391     operation, self.migration_context.impl.__dialect__
    392 )
--> 393 return fn(self, operation)

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/alembic/operations/toimpl.py:89, in drop_column(operations, operation)
     84 @Operations.implementation_for(ops.DropColumnOp)
     85 def drop_column(
     86     operations: \"Operations\", operation: \"ops.DropColumnOp\"
     87 ) -> None:
     88     column = operation.to_column(operations.migration_context)
---> 89     operations.impl.drop_column(
     90         operation.table_name, column, schema=operation.schema, **operation.kw
     91     )

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/alembic/ddl/impl.py:331, in DefaultImpl.drop_column(self, table_name, column, schema, **kw)
    324 def drop_column(
    325     self,
    326     table_name: str,
   (...)
    329     **kw,
    330 ) -> None:
--> 331     self._exec(base.DropColumn(table_name, column, schema=schema))

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/alembic/ddl/impl.py:193, in DefaultImpl._exec(self, construct, execution_options, multiparams, params)
    190     assert isinstance(multiparams, tuple)
    191     multiparams += (params,)
--> 193 return conn.execute(  # type: ignore[call-overload]
    194     construct, multiparams
    195 )

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/sqlalchemy/engine/base.py:1380, in Connection.execute(self, statement, *multiparams, **params)
   1376     util.raise_(
   1377         exc.ObjectNotExecutableError(statement), replace_context=err
   1378     )
   1379 else:
-> 1380     return meth(self, multiparams, params, _EMPTY_EXECUTION_OPTS)

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/sqlalchemy/sql/ddl.py:80, in DDLElement._execute_on_connection(self, connection, multiparams, params, execution_options)
     77 def _execute_on_connection(
     78     self, connection, multiparams, params, execution_options
     79 ):
---> 80     return connection._execute_ddl(
     81         self, multiparams, params, execution_options
     82     )

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/sqlalchemy/engine/base.py:1472, in Connection._execute_ddl(self, ddl, multiparams, params, execution_options)
   1467 dialect = self.dialect
   1469 compiled = ddl.compile(
   1470     dialect=dialect, schema_translate_map=schema_translate_map
   1471 )
-> 1472 ret = self._execute_context(
   1473     dialect,
   1474     dialect.execution_ctx_cls._init_ddl,
   1475     compiled,
   1476     None,
   1477     execution_options,
   1478     compiled,
   1479 )
   1480 if self._has_events or self.engine._has_events:
   1481     self.dispatch.after_execute(
   1482         self,
   1483         ddl,
   (...)
   1487         ret,
   1488     )

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/sqlalchemy/engine/base.py:1943, in Connection._execute_context(self, dialect, constructor, statement, parameters, execution_options, *args, **kw)
   1940             branched.close()
   1942 except BaseException as e:
-> 1943     self._handle_dbapi_exception(
   1944         e, statement, parameters, cursor, context
   1945     )
   1947 return result

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/sqlalchemy/engine/base.py:2124, in Connection._handle_dbapi_exception(self, e, statement, parameters, cursor, context)
   2122     util.raise_(newraise, with_traceback=exc_info[2], from_=e)
   2123 elif should_wrap:
-> 2124     util.raise_(
   2125         sqlalchemy_exception, with_traceback=exc_info[2], from_=e
   2126     )
   2127 else:
   2128     util.raise_(exc_info[1], with_traceback=exc_info[2])

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/sqlalchemy/util/compat.py:208, in raise_(***failed resolving arguments***)
    205     exception.__cause__ = replace_context
    207 try:
--> 208     raise exception
    209 finally:
    210     # credit to
    211     # https://cosmicpercolator.com/2016/01/13/exception-leaks-in-python-2-and-3/
    212     # as the __traceback__ object creates a cycle
    213     del exception, replace_context, from_, with_traceback

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/sqlalchemy/engine/base.py:1900, in Connection._execute_context(self, dialect, constructor, statement, parameters, execution_options, *args, **kw)
   1898                 break
   1899     if not evt_handled:
-> 1900         self.dialect.do_execute(
   1901             cursor, statement, parameters, context
   1902         )
   1904 if self._has_events or self.engine._has_events:
   1905     self.dispatch.after_cursor_execute(
   1906         self,
   1907         cursor,
   (...)
   1911         context.executemany,
   1912     )

File ~/.pyenv/versions/3.9.16/envs/encord_new_ui/lib/python3.9/site-packages/sqlalchemy/engine/default.py:736, in DefaultDialect.do_execute(self, cursor, statement, parameters, context)
    735 def do_execute(self, cursor, statement, parameters, context=None):
--> 736     cursor.execute(statement, parameters)

OperationalError: (sqlite3.OperationalError) near \"DROP\": syntax error
[SQL: ALTER TABLE active_project_analytics_data DROP COLUMN metric_annotation_quality]
(Background on this error at: https://sqlalche.me/e/14/e3q8)"
}

To reproduce

  1. Run this notebook
  2. Run the following cell:
# Choose where to store the data
project_path = Path.cwd() / project_name

# Download the dataset
fetch_prebuilt_project(project_name, project_path)

Additional information

No response

bug: Editor links doesn't work for COCO imports on

Provide environment information

Generic error. Not necessary.

Describe the bug

With the new local import of COCO projects, links to the Encord editor will no longer work.
We will need to detect when this is the case and avoid showing the link.

To reproduce

  1. Import a COCO project:
encord-active import project --coco -i ./images -a annotations.json
  1. Open the app with the newly imported projects.
  2. Go to the Explorer view
  3. Click the "✏️ editor" button.
  4. See the link being broken.

Additional information

To fix this, we should store when a project is imported from Encord vs. COCO and only show editor links when imported from Encord.

bug: Docker error OSError: Could not find lib geos_c or load any of its variants ['libgeos_c.so.1', 'libgeos_c.so'].

Provide environment information

(.venv) magedhelmy@Mageds-MacBook-Pro encord-active % encord-active print system-info

/Users/magedhelmy/Desktop/code/playground/encord-active/.venv/lib/python3.9/site-packages/urllib3/__init__.py:34: NotOpenSSLWarning: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
  warnings.warn(
System Information:
        System: Darwin
        Release: 22.2.0
        Machine: arm64
        Processor: arm
        Python: 3.9.6 (default, Oct 18 2022, 12:41:40) 
[Clang 14.0.0 (clang-1400.0.29.202)]

CPU Info:
        Physical cores: 10
        Total cores: 10
        Total CPU Usage: 0.0%

Memory Information:
        Total: 64.00GB
        Available: 20.75GB
        Used: 24.10GB

Describe the bug

I tried to set up the project using Docker as mentioned in the ReadME but I ended up with the message highlighted in the console.log below

To reproduce

Clone the latest version and run the following command check the console.log

docker run -it --rm -p 8501:8501 -p 8502:8502 -v

Additional information

Here is the console log

(.venv) magedhelmy@Mageds-MacBook-Pro encord-active % docker run -it --rm -p 8501:8501 -p 8502:8502 -v ${PWD}:/data encord/encord-active quickstart

Output destination: /data/quickstart
Do you want to re-download the project? [y/N]: y
Downloading sandbox project: 100%|#################################################################| 49.7M/49.7M [00:02<00:00, 23.5MB/s]
Unpacking zip file. May take a bit.
Migrating project at path: /data/quickstart...
Bear with us, this might take a short while...
Migrating project at path: /data/quickstart...

  You can now view your Streamlit app in your browser.

  Network URL: http://172.17.0.2:8501
  External URL: http://46.15.41.87:8501

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/encord_active/server/start_server.py", line 14, in <module>
    start(Path(sys.argv[1]), reload=("--reload" in sys.argv))
  File "/usr/local/lib/python3.11/site-packages/encord_active/server/start_server.py", line 10, in start
    run("encord_active.server.main:app", reload=reload, host="0.0.0.0", port=8502)
  File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 568, in run
    server.run()
  File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 59, in run
    return asyncio.run(self.serve(sockets=sockets))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
  File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 66, in serve
    config.load()
  File "/usr/local/lib/python3.11/site-packages/uvicorn/config.py", line 471, in load
    self.loaded_app = import_from_string(self.app)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 21, in import_from_string
    module = importlib.import_module(module_str)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/local/lib/python3.11/site-packages/encord_active/server/main.py", line 7, in <module>
    from encord_active.lib.model_predictions.reader import read_prediction_files
  File "/usr/local/lib/python3.11/site-packages/encord_active/lib/model_predictions/reader.py", line 10, in <module>
    from encord_active.lib.common.utils import load_json
  File "/usr/local/lib/python3.11/site-packages/encord_active/lib/common/utils.py", line 18, in <module>
    from shapely.geometry import Polygon
  File "/usr/local/lib/python3.11/site-packages/shapely/geometry/__init__.py", line 4, in <module>
    from .base import CAP_STYLE, JOIN_STYLE
  File "/usr/local/lib/python3.11/site-packages/shapely/geometry/base.py", line 20, in <module>
    from shapely.coords import CoordinateSequence
  File "/usr/local/lib/python3.11/site-packages/shapely/coords.py", line 10, in <module>
    from shapely.geos import lgeos
  File "/usr/local/lib/python3.11/site-packages/shapely/geos.py", line 100, in <module>
    _lgeos = load_dll('geos_c', fallbacks=alt_paths)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/shapely/geos.py", line 54, in load_dll
    raise OSError(
OSError: Could not find lib geos_c or load any of its variants ['libgeos_c.so.1', 'libgeos_c.so'].
2023-08-15 12:58:56.813 Uncaught app exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)
  File "/usr/local/lib/python3.11/site-packages/encord_active/app/streamlit_entrypoint.py", line 14, in <module>
    from encord_active.app.auth.jwt import auth
  File "/usr/local/lib/python3.11/site-packages/encord_active/app/auth/jwt.py", line 6, in <module>
    from encord_active.app.common.state_hooks import UseState
  File "/usr/local/lib/python3.11/site-packages/encord_active/app/common/state_hooks.py", line 6, in <module>
    from encord_active.app.common.state import StateKey
  File "/usr/local/lib/python3.11/site-packages/encord_active/app/common/state.py", line 10, in <module>
    from encord_active.lib.common.filtering import Filters
  File "/usr/local/lib/python3.11/site-packages/encord_active/lib/common/filtering.py", line 9, in <module>
    from encord_active.lib.model_predictions.types import PredictionsFilters
  File "/usr/local/lib/python3.11/site-packages/encord_active/lib/model_predictions/types.py", line 12, in <module>
    from encord_active.lib.model_predictions.writer import MainPredictionType
  File "/usr/local/lib/python3.11/site-packages/encord_active/lib/model_predictions/writer.py", line 19, in <module>
    from encord_active.lib.common.utils import RLEData, binary_mask_to_rle, rle_iou
  File "/usr/local/lib/python3.11/site-packages/encord_active/lib/common/utils.py", line 18, in <module>
    from shapely.geometry import Polygon
  File "/usr/local/lib/python3.11/site-packages/shapely/geometry/__init__.py", line 4, in <module>
    from .base import CAP_STYLE, JOIN_STYLE
  File "/usr/local/lib/python3.11/site-packages/shapely/geometry/base.py", line 20, in <module>
    from shapely.coords import CoordinateSequence
  File "/usr/local/lib/python3.11/site-packages/shapely/coords.py", line 10, in <module>
    from shapely.geos import lgeos
  File "/usr/local/lib/python3.11/site-packages/shapely/geos.py", line 100, in <module>
    _lgeos = load_dll('geos_c', fallbacks=alt_paths)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/shapely/geos.py", line 54, in load_dll
    raise OSError(
OSError: Could not find lib geos_c or load any of its variants ['libgeos_c.so.1', 'libgeos_c.so'].

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.