Coder Social home page Coder Social logo

ibeis's Introduction

ReadTheDocs Pypi Downloads Codecov GithubActions

https://i.imgur.com/L0k84xQ.png

This project is a component of the WildMe / WildBook project: See https://github.com/WildbookOrg/

NOTE: This IBEIS software is the result of my (Jon Crall's) [PhD work](https://github.com/Erotemic/crall-thesis-2017). After I graduated, the image analysis components of IBEIS and the core HotSpotter program have been transferred and are now being developed by the WildMe organization. While this software is maintained and supported, it can only handle medium scale populations and its it GUI interface can be difficult to work with. If you have a larger population or the need for simpler and scalable web interfaces please reach out to the WildMe project at [email protected] (more info: https://www.wildme.org/#/services/ ).

IBEIS - Image Analysis

I.B.E.I.S. = Image Based Ecological Information System

"(Note: the rhino and wildebeest matches may be dubious. Other species do work well though")

Installation Instructions (updated 2020-Nov-01)

The IBEIS software is now available on pypi for Linux systems. This means if you have Python installed. You can simply run:

pip install ibeis

to install the software. Then the command to run the GUI is:

ibeis

On Windows / OSX I recommend using a Linux virtual machine. However, if you are computer savvy it is possible to build all of the requirements on from source. The only tricky components are installing the packages with binary dependencies: pyhesaff and vtool_ibeis. If you have these built then the rest of the dependencies can be installed from pypi even on OSX / Windows.

NOTE: When using a VM on windows, you may encounter an error:

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in
... even though it was found. This application failed to start because no
Qt platform plugin could be initialized. Reinstalling the application may
fix this problem.

Available platform plugins are: xcb, eglfs, ...

Core dumped

The reason the issue happens appears to be because the opencv-python package includes libraries also packaged with PyQt5 and those are conflicting.

The workaround is to uninstall opencv-python and then install a variant that does not include extra Qt libs:

pip uninstall opencv-python
pip install opencv-python-headless

Basic Usage (updated 2020-Nov-01)

After installation running the ibeis command will open the GUI:

If you have already made a database, it will automatically open the most recently used database.

https://i.imgur.com/xXF7w8P.png

If this is the first time you've run the program it will not have a database opened:

https://i.imgur.com/Ey9Urcv.png

Select new database, (which will first ask you to select a work directory where all of your databases will live). Then you will be asked to create a database name. Select one and then create the database in your work directory.

You can drag and drop images into the GUI to add them to the database. Double clicking an image lets you add "annotations":

https://i.imgur.com/t0LQZot.png

You can also right click one or more images and click "Add annotations from entire images" if your images are already localized to a single individual.

It important than when you add an annotation, you set its species. You can right click multiple annotations and click "set annotation species". Change this to anything other than "____".

Once you have annotations with species, you can click one and press "q" to query for matches in the database of other annotations:

https://i.imgur.com/B0ilafa.png

Right clicking and marking each match as "True" or "False" (or alternatively selecting a row and pressing "T" or "F") will mark images as the same or different individuals. Groups marked as the same individual will appear in the "Tree of Names".

Note there are also batch identification methods in the "ID Encounters" "ID Exemplars" and "Advanced ID Interface" (my personal recommendation). Play around with different right-click menus (although note that some of these are buggy and will crash the program), but the main simple identification procedures are robust and should not crash.

Program Description

IBEIS program for the storage and management of images and derived data for use in computer vision algorithms. It aims to compute who an animal is, what species an animal is, and where an animal is with the ultimate goal being to ask important why biological questions. This This repo Image Analysis image analysis module of IBEIS. It is both a python module and standalone program.

Currently the system is build around and SQLite database, a PyQt5 GUI, and matplotlib visualizations. Algorithms employed are: random forest species detection and localization, hessian-affine keypoint detection, SIFT keypoint description, LNBNN identification using approximate nearest neighbors. Algorithms in development are SMK (selective match kernel) for identification and deep neural networks for detection and localization.

The core of IBEIS is the IBEISController class. It provides an API into IBEIS data management and algorithms. The IBEIS API Documentation can be found here: http://erotemic.github.io/ibeis

The IBEIS GUI (graphical user interface) is built on top of the API. We are also experimenting with a new web frontend that bypasses the older GUI code.

Self Installing Executables

Unfortunately we have not released self-installing-executables for IBEIS yet. We ~plan~ hope to release these soon™.

However there are old [HotSpotter](https://github.com/Erotemic/hotspotter) (the predecessor to IBEIS) binaries available.

Dropbox should still be hosting the download links:

IPFS CIDs for the previous installers are QmSnyetkniriHUwTxvzwhkysPKjUj7udBqq5mpK24VJXVM and QmZ3WknrAaxPZhZebdQWZ45EEKwu1Tr6bkFWJzfPRtENs7.

If you are unfamiliar with IPFS use the following gateway links:

https://ipfs.io/ipfs/QmSnyetkniriHUwTxvzwhkysPKjUj7udBqq5mpK24VJXVM

https://ipfs.io/ipfs/QmZ3WknrAaxPZhZebdQWZ45EEKwu1Tr6bkFWJzfPRtENs7

Visual Demo

Feature Extraction

Nearest Neighbors

Match Scoring

Match Inspection

Spatial Verification

sver

python -m vtool.spatial_verification spatially_verify_kpts --show

Name Scoring

namematch

python -m ibeis.algo.hots.chip_match show_single_namematch --qaid 1 --show

Identification Ranking

rankedmatches

python -m ibeis.algo.hots.chip_match show_ranked_matches --show --qaid 86

Inference

encgraph

# broken
# python -m ibeis.algo.preproc.preproc_encounter compute_encounter_groups --show

Internal Modules

In the interest of modular code we are actively developing several different modules.

ibeis ibeisGithubActions
utool utoolGithubActions
plottool_ibeis plottool_ibeisGithubActions
guitool_ibeis guitool_ibeisGithubActions
dtool_ibeis dtool_ibeisGithubActions
pyhesaff pyhesaffGithubActions
pyflann_ibeis pyflann_ibeisGithubActions
vtool_ibeis vtool_ibeis_extGithubActions
futures_actors ---

bluemellophone's IBEIS Image Analysis modules

Building from source

To build from source you need to be able to build the following 3 projects with binary dependences. These depened on having a development version of OpenCV and LZ4.

If you are on Linux simply using the wheels for the above projects ( i.e. pip install vtool_ibeis_ext pyflann_ibeis pyhesaff is recommended). On OSX and Win32 these need to be build manually (any contributions to help these build win32 or osx wheels on their respective project CI would be amazing!).

The rest of the dependency repos (guitool_ibeis, plottool_ibeis, dtool_ibeis, vtool_ibeis,) are pure python and can be installed in development mode with the normal clone the repo, and run pip install -e . inside the repo process.

Given a Python environment where each of the dependency modules is installed this repo can be installed with pip install -e . as well.

Demo Databases

A set of small (400MB) demo databases PZ_MTEST1 and NAUT_TEST can be downloaded via.

python dev/reset_dbs.py

Note that it downloads the data from an IPFS gateway, which may be slow and require several attempts before it works.

Running Tests

The tests depend on an even smaller set of test databases, which can be prepared via ibeis --reset-ci-dbs. Once you have the test data you can use the run_doctests.sh or run_tests.py script to execute the system tests.

Known issues

  • We do not add or remove points from kdtrees. They are always rebuilt
  • Changing algorithm settings in the preferences window seems bugged and probably requires a fix in utool. The default settings should work and using the Python API with explicit algorithm settings should also be fine.
  • The code is a mess! PRs are welcome!
  • The UI has lots of unused or broken components. PRs to disable or make these nicer are welcome!
  • The only blockers for Windows / OSX pip installs are pyhesaff, pyflann_ibeis, and vtool_ibeis_ext binary wheels. Getting these to build on Github Actions would mean pip installable IBEIS on non-Linux systems.

Citations and Related Work

The best citation for this work would be my thesis.

@phdthesis{crall_identifying_2017,
  address = {Troy, NY},
  author = {Crall, Jonathan P.},
  school = {Department of Computer Science, Rensselaer Polytechnic Institute},
  title = {Identifying {Individual} {Animals} using {Ranking}, {Verification}, and {Connectivity}},
  type = {Ph.{D}. {Thesis}},
  year = {2017}
}

The original HotSpotter paper is:

Crall, Stewart, Bertger-Wolf, Rubenstein, and Sundaresan. "HotSpotter - Patterned Species Instance Recognition" WACV 2013

Other relevant citations are:

Parham, Jason. "Animal Detection for Photographic Censusing" RPI PhD Thesis 2021

Weideman, Hendrik. "Contour-Based Instance Recognition of Animals" RPI PhD Thesis 2019

Parham, Crall, Stewart, Berger-Wolf, and Rubenstein, "Animal population censusing at scale with citizen science and photographic identification" AAAI 2017

ibeis's People

Contributors

audreybeard avatar aweinstock314 avatar bluemellophone avatar crowmagnumb avatar danlowe95 avatar erotemic avatar eylor avatar hjweide avatar jonwrona avatar zmjjmz avatar zrutfield 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

Watchers

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

ibeis's Issues

set_roi_bboxes should modify roi_verts and visversa

set_roi_bboxes and set_roi_verts are manipulating the same conceptual information so they should modify each others properties in the database

Ideally set_roi_bboxes would not exist, but it would be too much work to remove that right now. Or perhaps it would just modify the scale of any existing polygon (which would have the right effect on base case (rectangle) polygons)

set_roi_num_verts should be removed or flaged as a private / protected function. the user should not modify that data as it belongs conceptually to the idea of the bounding polygon.

Detector should not re-detect

The detector should only run on images where the detector has not been run on before (even if no ROIs were detected).

The nn_indexer uuid map is never synced to disk

The nn_indexer uuid map maps a set of uuids to a prebuilt nearest neighbor indexer.

In previous versions of the code the mapping was stored on disk, but reading and writing on every query became expensive so an in-memory solution was adopted.

However, the in memory solution nevery syncs itself to disk, so if IBEIS closes the cache is effectively lost even though the neighbor indexes are sitting there on disk. So, this isn't a problem if you never close IBEIS.

There should be a simple mechanism to sync this to disk and load it. I'm currently not sure when these save and load points should be.

WEB UI

Hi,

Is there any version of IBEIS working with a web UI for the backend ?

Cheers,
Luc Michalski

AttributeError: FLANN instance has no attribute 'add_points'

Need help on the below, encountered the below error while running ibeis. Thanks!

[nnindex] Adding 6147 vecs from 8 annots to nnindex with 347035 vecs and 387 annots
Traceback (most recent call last):
File "/Users/SC/code/ibeis/ibeis/model/hots/qt_inc_automatch.py", line 326, in next_query_slot
item = six.next(self.inc_query_gen)
File "/Users/SC/code/ibeis/ibeis/model/hots/automated_matcher.py", line 138, in generate_incremental_queries
for item in generate_subquery_steps(ibs, qaid_chunk, incinfo=incinfo):
File "/Users/SC/code/ibeis/ibeis/model/hots/automated_matcher.py", line 231, in generate_subquery_steps
qaid2_qres, qreq_ = execute_query_batch(ibs, qaid_chunk, qreq_vsmany_, incinfo)
File "/Users/SC/code/ibeis/ibeis/model/hots/automated_matcher.py", line 199, in execute_query_batch
qaid2_qres = mc4.submit_query_request_nocache(ibs, qreq_=qreq_)
File "/Users/SC/code/ibeis/ibeis/model/hots/match_chips4.py", line 76, in submit_query_request_nocache
qaid2_qres = execute_query2(ibs, qreq_, verbose, save_qcache)
File "/Users/SC/code/ibeis/ibeis/model/hots/match_chips4.py", line 259, in execute_query2
qaid2_qres = pipeline.request_ibeis_query_L0(ibs, qreq, verbose=verbose)
File "/Users/SC/code/ibeis/ibeis/model/hots/pipeline.py", line 167, in request_ibeis_query_L0
qreq
.lazy_load(verbose=verbose)
File "/Users/SC/code/ibeis/ibeis/model/hots/query_request.py", line 670, in lazy_load
qreq
.load_indexer(verbose=verbose)
File "/Users/SC/code/ibeis/ibeis/model/hots/query_request.py", line 787, in load_indexer
indexer = neighbor_index.request_ibeis_nnindexer(qreq
, verbose=verbose, **qreq
._indexer_request_params)
File "/Users/SC/code/ibeis/ibeis/model/hots/neighbor_index.py", line 292, in request_ibeis_nnindexer
force_rebuild=force_rebuild)
File "/Users/SC/code/ibeis/ibeis/model/hots/neighbor_index.py", line 383, in request_augmented_ibeis_nnindexer
base_nnindexer.add_support(new_daid_list, new_vecs_list, new_fgws_list, verbose=True)
File "/Users/SC/code/ibeis/ibeis/model/hots/neighbor_index.py", line 952, in add_support
nnindexer.flann.add_points(new_idx2_vec)
AttributeError: FLANN instance has no attribute 'add_points'

add_labels should create name-independent uuids

In IBEISControl, add_labels should not base its uuids on the names, because in the situation that two users give the same name to two different animals, these animals will end up with the same uuid.

All paths in SQL files should be relative.

We need to verify this for relative images (should nonlocal images be kept absolute?), chips, thumbnails, and anything else stored as a file path in sql files.

We should actually check this for all files.

Things to verify:

  • chips
  • chip thumbnails
  • query results
  • images (localized only?)
  • image thumbnails

Query Result Widget needs to be incorporated into tab_wgt

This also involves consolidating the other IBEISTableWidgets and their models and views.
Each tab should contain its own APITableWidget (or some subclass), and that widget contains both the model and the view. The APITabelWidget should be initalized with a view, and be able to construct a model on the fly.

The QueryResultsWidget needs to be able to write back to the IBEIS Control.

Meanshift crashes on small input

When using the meanshift algorithm to compute encounter there is an error deep within scipy. I got this running test_gui_all, so compute encounters on testdb1 should reproduce this.

It probably shouldnt work on small input, but it shouldnt crash either!

Define schema only when necessary

DB_SCHEMA.define_IBEIS_schema should only be called if the database is new.
It is currently taking up about 1.5 seconds of startup time, which is a lot for a simple call.

Need easy way to get from an annotation to its parent image in the GUI

Sometimes a user will want to see the full image that an annotation is from. Currently you have to look at the source image, and then find that source image in the image table.

There should be a context option which lets you move from a selected annotation to its parent image.

tests_ibs_encounters fails

The target data seems to not work when you change machines. The encounter-ids (eids) are being generated for region-of-interest-ids (rids) should be deterministic. But this seems not be be the case. There is either an error adding rois or clustering encounters.

the test is in ibeis/tests/test_ibs_encounters.py

Memory Leak in API_ThumbDelegate

When scrolling up and down qt tables memory is allocated but not deleted. This doesn't seem to happen if there are no thumbnails showing.

Computing thumbnails lazily on an empty database can cause crashes and sometimes hangs.

I've made a new database with 111 images and I start scrolling down.

and I get many error messages that look like this:

[!imread] [!?] Caught exception
<class 'cv2.error'>: c:/Users/joncrall/code/opencv/modules/core/src/alloc.cpp:52: error: (-4) Failed to allocate 53747712 bytes in function OutOfMemoryError

</!!! WARNING !!!>

L______

[gtool] cannot read img_fpath=F:\data\sussanes_hsdbs\Zebra 2012\_ibsdb\images\c64f7557-a1ee-53bd-4bda-4a10887f6237.jpg seems corrupted.

+------

<!!! EXCEPTION !!!>
Traceback (most recent call last):
  File "c:\users\joncrall\code\guitool\guitool\api_thumb_delegate.py", line 287, in run
    thread._run()
  File "c:\users\joncrall\code\guitool\guitool\api_thumb_delegate.py", line 275, in _run
    img = gtool.imread(thread.img_path)  # Read Image (.0424s) <- Takes most time!
  File "c:\users\joncrall\code\vtool\vtool\image.py", line 94, in imread
    raise IOError(msg)
IOError: cannot read img_fpath=F:\data\sussanes_hsdbs\Zebra 2012\_ibsdb\images\c64f7557-a1ee-53bd-4bda-4a10887f6237.jpg seems corrupted.

[!run] thread failed
<type 'exceptions.IOError'>: cannot read img_fpath=F:\data\sussanes_hsdbs\Zebra 2012\_ibsdb\images\c64f7557-a1ee-53bd-4bda-4a10887f6237.jpg seems corrupted.
</!!! EXCEPTION !!!>

L______

OpenCV Error: Unspecified error (The numpy array of typenum=2, ndims=3 can not be created) in allocate, file c:/Users/joncrall/code/opencv/modules/python/src2/cv2.cpp, line 228
OpenCV Error: Insufficient memory (Failed to allocate 53747712 bytes) in OutOfMemoryError, file c:/Users/joncrall/code/opencv/modules/core/src/alloc.cpp, line 52

+------

<!!! WARNING !!!>
[!imread] [!?] Caught exception
<class 'cv2.error'>: c:/Users/joncrall/code/opencv/modules/core/src/alloc.cpp:52: error: (-4) Failed to allocate 53747712 bytes in function OutOfMemoryError

</!!! WARNING !!!>

L______

[gtool] cannot read img_fpath=F:\data\sussanes_hsdbs\Zebra 2012\_ibsdb\images\f8624f22-0f43-a34a-ddae-bba5ee1fceee.jpg seems corrupted.

+------

<!!! EXCEPTION !!!>
Traceback (most recent call last):
  File "c:\users\joncrall\code\guitool\guitool\api_thumb_delegate.py", line 287, in run
    thread._run()
  File "c:\users\joncrall\code\guitool\guitool\api_thumb_delegate.py", line 275, in _run
    img = gtool.imread(thread.img_path)  # Read Image (.0424s) <- Takes most time!
  File "c:\users\joncrall\code\vtool\vtool\image.py", line 94, in imread
    raise IOError(msg)
IOError: cannot read img_fpath=F:\data\sussanes_hsdbs\Zebra 2012\_ibsdb\images\f8624f22-0f43-a34a-ddae-bba5ee1fceee.jpg seems corrupted.

[!run] thread failed
<type 'exceptions.IOError'>: cannot read img_fpath=F:\data\sussanes_hsdbs\Zebra 2012\_ibsdb\images\f8624f22-0f43-a34a-ddae-bba5ee1fceee.jpg seems corrupted.
</!!! EXCEPTION !!!>

L______

OpenCV Error: Unspecified error (The numpy array of typenum=2, ndims=3 can not be created) in allocate, file c:/Users/joncrall/code/opencv/modules/python/src2/cv2.cpp, line 228
OpenCV Error: Insufficient memory (Failed to allocate 53747712 bytes) in OutOfMemoryError, file c:/Users/joncrall/code/opencv/modules/core/src/alloc.cpp, line 52

+------

<!!! WARNING !!!>
[!imread] [!?] Caught exception
<class 'cv2.error'>: c:/Users/joncrall/code/opencv/modules/core/src/alloc.cpp:52: error: (-4) Failed to allocate 53747712 bytes in function OutOfMemoryError

</!!! WARNING !!!>

L______

[gtool] cannot read img_fpath=F:\data\sussanes_hsdbs\Zebra 2012\_ibsdb\images\64cc0697-c135-b40c-dee7-b3bc359c22f4.jpg seems corrupted.

+------

<!!! EXCEPTION !!!>
Traceback (most recent call last):
  File "c:\users\joncrall\code\guitool\guitool\api_thumb_delegate.py", line 287, in run
    thread._run()
  File "c:\users\joncrall\code\guitool\guitool\api_thumb_delegate.py", line 275, in _run
    img = gtool.imread(thread.img_path)  # Read Image (.0424s) <- Takes most time!
  File "c:\users\joncrall\code\vtool\vtool\image.py", line 94, in imread
    raise IOError(msg)
IOError: cannot read img_fpath=F:\data\sussanes_hsdbs\Zebra 2012\_ibsdb\images\64cc0697-c135-b40c-dee7-b3bc359c22f4.jpg seems corrupted.

[!run] thread failed
<type 'exceptions.IOError'>: cannot read img_fpath=F:\data\sussanes_hsdbs\Zebra 2012\_ibsdb\images\64cc0697-c135-b40c-dee7-b3bc359c22f4.jpg seems corrupted.
</!!! EXCEPTION !!!>

L______

What should happen is thumbnails should be silently computed in the background (maybe unless the utool.VERYVERBOSE flag is specified?)

Another related issue is when I click Batch->Compute all thumbnails

I'll get output that looks like this

[guitool.qtapp_loop()] ENTERING
[guitool.qtapp_loop()] starting qt app loop: qwin=<ibeis.gui.newgui.IBEISMainWindow object at 0x0DB5FDA0>
[guitool] qapp.setActiveWindow(qwin)
[guitool.qtapp_loop()] qapp.exec_()  # runing main loop
[back] compute_thumbs
[ibsfuncs] preprocess_image_thumbs
[util_parallel.init_pool] initializing pool with 7 processes
[util_parallel._generate_parallel] executing 111 draw_thumb_helper tasks using 7 processes with chunksize=8
draw_thumb_helper:     0/111...  rate=-1.00 iters per second. est_min_left=-1.00, total_min=0.00,
draw_thumb_helper:     5/111...  rate=0.77 iters per second. est_min_left=2.33, total_min=0.11,
draw_thumb_helper:     9/111...  rate=30.53 iters per second. est_min_left=0.06, total_min=0.11,
draw_thumb_helper:    20/111...  rate=65.87 iters per second. est_min_left=0.02, total_min=0.11,
draw_thumb_helper:    43/111...  rate=6.07 iters per second. est_min_left=0.19, total_min=0.18,
draw_thumb_helper:    85/111...  rate=2.48 iters per second. est_min_left=0.18, total_min=0.46,
OpenCV Error: Unspecified error (The numpy array of typenum=2, ndims=3 can not be created) in allocate, file c:/Users/joncrall/code/opencv/modules/python/src2/cv2.cpp, line 228
OpenCV Error: Insufficient memory (Failed to allocate 53747712 bytes) in OutOfMemoryError, file c:/Users/joncrall/code/opencv/modules/core/src/alloc.cpp, line 52

+------

<!!! WARNING !!!>
[!imread] [!?] Caught exception
<class 'cv2.error'>: c:/Users/joncrall/code/opencv/modules/core/src/alloc.cpp:52: error: (-4) Failed to allocate 53747712 bytes in function OutOfMemoryError

</!!! WARNING !!!>

L______

OpenCV Error: Unspecified error (The numpy array of typenum=2, ndims=3 can not be created) in allocate, file c:/Users/joncrall/code/opencv/modules/python/src2/cv2.cpp, line 228
OpenCV Error: Insufficient memory (Failed to allocate 53747712 bytes) in OutOfMemoryError, file c:/Users/joncrall/code/opencv/modules/core/src/alloc.cpp, line 52

+------

<!!! WARNING !!!>
[!imread] [!?] Caught exception
<class 'cv2.error'>: c:/Users/joncrall/code/opencv/modules/core/src/alloc.cpp:52: error: (-4) Failed to allocate 53747712 bytes in function OutOfMemoryError

</!!! WARNING !!!>

L______

[gtool] cannot read img_fpath=F:\data\sussanes_hsdbs\Zebra 2012\_ibsdb\images\b13d8beb-1bff-a462-b2f4-83469ec9a6ad.jpg seems corrupted.

+------

<!!! EXCEPTION !!!>
[utool] Parallel Generation Failed!
<type 'exceptions.IOError'>: cannot read img_fpath=F:\data\sussanes_hsdbs\Zebra 2012\_ibsdb\images\b13d8beb-1bff-a462-b2f4-83469ec9a6ad.jpg seems corrupted.
</!!! EXCEPTION !!!>

L______

__SERIAL_FALLBACK__ = True
[util_parallel._generate_serial] executing 111 draw_thumb_helper tasks in serial
draw_thumb_helper:     0/111...  rate=-1.00 iters per second. est_min_left=-1.00, total_min=0.00,
[gtool] cannot read img_fpath=F:\data\sussanes_hsdbs\Zebra 2012\_ibsdb\images\9dfc2caa-a7fd-5cb1-ad2d-cf3d46e90b56.jpg seems corrupted.
draw_thumb_helper:     5/111...  rate=2.11 iters per second. est_min_left=0.84, total_min=0.04,
draw_thumb_helper:     9/111...  rate=2.12 iters per second. est_min_left=0.81, total_min=0.07,
draw_thumb_helper:    13/111...  rate=2.16 iters per second. est_min_left=0.76, total_min=0.10,
draw_thumb_helper:    17/111...  rate=2.20 iters per second. est_min_left=0.72, total_min=0.13,
OpenCV Error: Unspecified error (The numpy array of typenum=2, ndims=3 can not be created) in allocate, file c:/Users/joncrall/code/opencv/modules/python/src2/cv2.cpp, line 228
OpenCV Error: Insufficient memory (Failed to allocate 53747712 bytes) in OutOfMemoryError, file c:/Users/joncrall/code/opencv/modules/core/src/alloc.cpp, line 52

+------

<!!! WARNING !!!>
[!imread] [!?] Caught exception
<class 'cv2.error'>: c:/Users/joncrall/code/opencv/modules/core/src/alloc.cpp:52: error: (-4) Failed to allocate 53747712 bytes in function OutOfMemoryError

</!!! WARNING !!!>

L______

[gtool] cannot read img_fpath=F:\data\sussanes_hsdbs\Zebra 2012\_ibsdb\images\934cd2b9-3857-6808-d5d0-0176c3012a71.jpg seems corrupted.
Traceback (most recent call last):
  File "C:\Users\joncrall\code\ibeis\ibeis\gui\guiback.py", line 44, in backreport_wrapper
    result = func(back, *args, **kwargs)
  File "C:\Users\joncrall\code\ibeis\ibeis\gui\guiback.py", line 65, in bacblock_wrapper
    result = func(back, *args, **kwargs)
  File "C:\Users\joncrall\code\ibeis\ibeis\gui\guiback.py", line 90, in wrapped_bslot
    result = func(*args, **kwargs)
  File "C:\Users\joncrall\code\ibeis\ibeis\gui\guiback.py", line 713, in compute_thumbs
    ibsfuncs.compute_all_thumbs(back.ibs, eid=eid)
  File "C:\Users\joncrall\code\ibeis\ibeis\ibsfuncs.py", line 1771, in compute_all_thumbs
    preprocess_image_thumbs(ibs, **kwargs)
  File "C:\Users\joncrall\code\ibeis\ibeis\ibsfuncs.py", line 1764, in preprocess_image_thumbs
    six.next(gen)
  File "c:\users\joncrall\code\utool\utool\util_parallel.py", line 208, in _generate_parallel
    verbose=verbose, nTasks=nTasks):
  File "c:\users\joncrall\code\utool\utool\util_parallel.py", line 228, in _generate_serial
    result = func(args)
  File "C:\Users\joncrall\code\ibeis\ibeis\ibsfuncs.py", line 1705, in draw_thumb_helper
    img = gtool.imread(gpath)  # time consuming
  File "c:\users\joncrall\code\vtool\vtool\image.py", line 94, in imread
    raise IOError(msg)
IOError: cannot read img_fpath=F:\data\sussanes_hsdbs\Zebra 2012\_ibsdb\images\934cd2b9-3857-6808-d5d0-0176c3012a71.jpg seems corrupted.

There seems to be a memory issue with the thumbnails. The image that is reported to be corrupted is not. Instead what I think is happening is too much memory is being allocated and not freed. We should probably see if we can reduce memory usage in whatever the create thumbnail function is.
print(ut.get_resource_usage_str()) should help with this.

It might also be a good idea to restrict the number of threads that can be spawned to compute thumbnails in the qthumbnail_delegate in guitool.

EDIT:

My system information:
[var] <type 'str'> platform.machine() = 'AMD64'
[var] <type 'str'> platform.node() = 'Ooo'
[var] <type 'str'> platform.processor() = 'Intel64 Family 6 Model 42 Stepping 7, GenuineIntel'
[var] <type 'str'> platform.python_branch() = ''
[var] <type 'tuple'> platform.python_build() = ('default', 'Jun 30 2014 16:03:49')
[var] <type 'str'> platform.python_compiler() = 'MSC v.1500 32 bit (Intel)'
[var] <type 'str'> platform.python_implementation() = 'CPython'
[var] <type 'str'> platform.python_revision() = ''
[var] <type 'str'> platform.python_version() = '2.7.8'
[var] <type 'tuple'> platform.python_version_tuple() = ('2', '7', '8')
[var] <type 'str'> platform.release() = '7'
[var] <type 'str'> platform.system() = 'Windows'
[var] <type 'tuple'> platform.uname() = ('Windows', 'Ooo', '7', '6.1.7601', 'AMD64', 'Intel64 Family 6 Model 42 Stepping 7, GenuineIntel')
[var] <type 'str'> platform.version() = '6.1.7601'
[var] <type 'int'> multiprocessing.cpu_count() = 8
[var] <type 'str'> sys.platform = 'win32'
[var] <type 'str'> os.getcwd() = 'C:\Users\joncrall\code\ibeis'
[var] <type 'bool'> utool.is64bit_python() = False
[var] <type 'int'> sys.maxint = 2147483647

Python Site:
[var] <type 'list'> len(site.getsitepackages()) = ['C:\Python27', 'C:\Python27\lib\site-packages']
[var] <type 'str'> site.getusersitepackages() = 'C:\Users\joncrall\AppData\Roaming\Python\Python27\site-packages'

Memory Status:
[psutil] total = 7.97 GB
[psutil] available = 6.24 GB
[psutil] used = 1.73 GB
[psutil] current = 79.70 MB
no module resources (doesnt exist on win32)
[var] <type 'str'> cv2.version = '3.0.0-dev'

The Review Detections button need to be implemented.

Each image should get a "reviewed" boolean SQL property as well as a detection confidence float.

The detection confidence just denotes that this image has had detection run on it. The reviewed flag indicates that a user has oked the detection (and possibly edited them). This should be separated from the AIF (rename to "detection-completed" or completed) which should denote that there are no more detection to be made on this image. It is "pristine".

When the user clicks the review detections button the images with a confidence that have not been reviewed should be fed into the multimage-interaction and have their ROIs edited.
When reviewed, the reviewed flag should be set to True, and the AIF flag should be set to True UNLESS the user says the detection is bad (they may want to come back to it later, and just say yes to the good results).

pyrf and pyflann fails to build on super_setup

There is some issue. the build dir and the egg file are listed as owned by root, and thus it cannot be removed by the unix_build.sh in pyrf. manually deleting these and running
./unix build
sudo python2.7 setup.py develop

seems to work

pyflann is build in the python2.6 lib

hesaff is failing too. same root problems

probably unrelated buy pyqt4 is failing as well. No module pyqtcore

this is all on centos.

Web Turking Interface Refactor

refactor the javascript detection annotation code to include:

  • correct rotation and resizing
  • fix turk instructions scrolling
  • right click to resize annotations

Build Issues on OSX

Corrections to how to install....

---- 1. Don't need to explicitly install gcc48, g++ or gfortran. scipy is what needs them and goes and gets what it needs.
JASON: We might want to force specific compiler versions that scipy will use
---- 2. No jpg
---- 3. libjpeg -> jpeg
---- 4. libtiff -> tiff
---- 5. littlecms does not exit in macports. Ignoring for now...
---- 6. fftw3 fftw-3
---- 7. atlas requires a fortran compiler, which I didn't waste time building...
JASON: We might want to force specific compiler versions that scipy will use
---- 8. py-qt4 -> py-pyqt4
---- 9. need sudo pip install parse
---- 10. Don't need pyinstaller.
---- 11. Need to do three port selects:
sudo port select --set python python27
sudo port select --set ipython ipython27
sudo port select --set cython cython27
sudo port select --set pip pip27
---- 12. sudo pip install git+https://github.com/amitdev/lru-dict

Building:
---- 1. Build clang2 locally
. check to see that the path to llvm etc...
---- 2. Turn off clang2 in hesaff

StripeProxyModel thumbnail images are occasionally unresponsive to double click

Sometimes, clicking on a thumbnail image in the images table view does not open the thumbnail (it registers the double click as two single clicks). The click appears as an event in the terminal output, but the image is not opened. However, at other times the image opens as expected.

This bug has been isolated to the image_grid table because it is the only view that is currently using the StripeProxyModel

Efficiency of Special Encounters

It would be nice to do some special casing of the "special" encounters because currently one of the main delays in startup time is deleting and then reading all the image-encounter relationships.

File: ibeis\control\IBEISControl.py
Function: add_encounters at line 725
Total time: 0.379971 s

Line # Hits Time Per Hit % Time Line Contents

725 @adder
726 def add_encounters(ibs, enctext_list):
727 """ Adds a list of names. Returns their nids """
728 6 27 4.5 0.0 if utool.VERBOSE:
729 print('[ibs] adding %d encounters' % len(enctext_list))
730 # Add encounter text names to database
731 6 57 9.5 0.0 notes_list = [''] * len(enctext_list)
732 31 3846 124.1 0.3 encounter_uuid_list = [uuid.uuid4() for _ in xrange(len(enctext_list))]
733 6 28 4.7 0.0 colnames = ['encounter_text', 'encounter_uuid', 'encounter_note']
734 6 40 6.7 0.0 params_iter = izip(enctext_list, encounter_uuid_list, notes_list)
735 6 77 12.8 0.0 get_rowid_from_uuid = partial(ibs.get_encounter_eids_from_text, ensure=False)
736
737 6 1261676 210279.3 99.7 eid_list = ibs.db.add_cleanly(ENCOUNTER_TABLE, colnames, params_iter, get_rowid_from_uuid)
738 6 30 5.0 0.0 return eid_list

File: ibeis\control\IBEISControl.py
Function: set_image_enctext at line 780
Total time: 0.567254 s

Line # Hits Time Per Hit % Time Line Contents

780 @Setter
781 def set_image_enctext(ibs, gid_list, enctext_list):
782 """ Sets the encoutertext of each image """
783 3 15 5.0 0.0 if utool.VERBOSE:
784 print('[ibs] setting %r image encounter ids' % len(gid_list))
785 3 870500 290166.7 46.1 eid_list = ibs.add_encounters(enctext_list)
786 3 1019138 339712.7 53.9 egrid_list = ibs.add_image_relationship(gid_list, eid_list)
787 3 18 6.0 0.0 del egrid_list

File: ibeis\control\IBEISControl.py
Function: delete_encounters at line 1948
Total time: 0.594904 s

Line # Hits Time Per Hit % Time Line Contents

1948 @deleter
1949 def delete_encounters(ibs, eid_list):
1950 """ Removes encounters (images are not effected) """
1951 3 11 3.7 0.0 if utool.VERBOSE:
1952 print('[ibs] deleting %d encounters' % len(eid_list))
1953 3 32245 10748.3 1.6 egrid_list = utool.flatten(ibs.get_encounter_egrids(eid_list))
1954 3 737463 245821.0 37.2 ibs.db.delete_rowids(EG_RELATION_TABLE, egrid_list)
1955 3 1212060 404020.0 61.2 ibs.db.delete_rowids(ENCOUNTER_TABLE, eid_list)

GUI ENHANCEMENTS

  • DONE * Detection reveiwed column can be hidden
  • DONE JON: * The special encounters can be removed/hidden
  • DONE JON: * Encounters need a review flag
  • DONE JON: * Encounters need to be grouped by unreviewed
  • DONE JON: * Group encounters should only group images that do not belong to any encounter
    ( except if there is a specieal encounter for encounterless images)
  • DONE Encounter table is not getting updated correctly. Deleting encounters and changing encounter membership does not update the information displayed in the encounter table
  • DONE Encounter computation needs to not put images back in encounters they were removed from. Done simply by 'locking' existing encounters when computing encounter clusters.
  • DONE ARE YOU SURE DIALOG BEFORE RUNNING DETECTION. Tell the user the species it is running on and the number of images to be detected on. Give a rough time estimate based on 40 / num_cores seconds per image.
  • DONE Run idetification with resepct to a species. Tell user which species, tell user how many annotation in this encounter do not have that species. When running identification ensure that all.
  • DONE Image thumbnails did not get updated when detector was run. Make sure that all thumbnails are computed with respect to ibs.cfg.other_cfg.thumbnail_size. This is mostly fixed. Ensure that thumbnails are refreshing when theyshould be.
  • DONE Ask are you sure before merging animals. ie when selecting multiple results as correct.
  • DONE Close identification reveiw interface on completion
  • DONE Denote progress in review interface.
  • DONE Hide isExemplar interface from names tree, hide name notes,
  • DONE Write fix that ensures no annotations who name rowid == 0 (i.e. unknown animal) are set as exemplars
  • DONE Ensure GUI is always running in versus exemplar mode
  • DONE Fix bug in Decision GUI where Examine causes everything to hang.
  • Visual break between different animals in names tree. This involves enhancing guitool's api_tree_view/api_item_view (and possibly api_item_model) to alternate the colors of rows in level 0 of the tree)
  • When the user opens a new database the tables of the old database are refreshed before the new database is loaded. This should not happen. (this is similar to the issue where the tables refreshed on python's exit, but maybe it is caused by something less trivial?)
  • DONE The user should be able to right click on a name / annotation and get a context menu allowing for different actions in the name tree view.
    1. right click annot in annotation table and go to annot in the name tree
    2. right click annot in name tree and go to annot in the annotation table
  • Run multiple (in terms of species) detectors at once?
    JASON: This cannot be done without spawning new processes for the C++ code
  • DONE Matplotlib combo-box species selection in annotation interaction (Sort of done, just tab complete for now)
  • Need interface (a simple text dialog available in guiback back.user_input) for the user to enter a true encounter time which augments the image_timedelta_posix column for each image in the encounter. There should be a get_image_truetime function which returns the image_time_posix + image_timedelta_posix and this should be used in preproc_encounter for encounter clustering.
  • Allow for the user to specify custom column names to enable/disable in the gui tables. (This involves making guiheaders more dynamic, but it is fine if the user has to restart the program to see the effects.)
  • Likewise allows users to specify which special encounters are enabled / disabled.
  • Allow for a custom species to be specified. We don't want to put the user in a box where they are constrained by our workflow. Let the users be creative. We can suggest our workflow, but it may not be the right thing to do for everyone.

Config Rowids for features, chips, featweights, etc... do not work unless the main IBIES config object is set.

To get features like rotational invariance on the fly for IBEIS test or to specify special paramaters for cached value the main ibs.cfg object needs to be set. The ibs.*.get_cfgstr() is used to get the config_rowid for any table that uses them. The autogenerated templates seek to rectify this by specifying qreq_ as an argument, but even where it is fully implemented (fgweights) it will not work unless the qreq_ object is passed through every ibeis call.

Need to add it to ibs.get_annot_fgweights ibs.get_annot_kpts ibs.get_annot_vecs, ibs.get_annot_chipsize ibs.get_annot_chip/feat/everything.

However it would be better to just a simpler object be passed down than a query request (maybe a dict of config_rowids)? Maybe qreq_ should have a polymorphic structure to the IBEIS controller that calls the ibeis functions and forces itself to be specified as the config object?

Adding ___ as a species results in ____ being addeed to the lblannot table

The idea was that ____ should never be stored as a value in the lblannot table because it represents an unknown value.

Test code for this example is provided in the example section of get_species_lblannot_rowid and copied here for convenience

        Example:
            >>> from ibeis.control.IBEISControl import *  # NOQA
            >>> import ibeis
            >>> import utool
            >>> ibs = ibeis.opendb('testdb1')
            >>> species_list = [u'jaguar', u'zebra_plains',
            ...                 u'zebra_plains','____', u'zebra_grevys',
            ...                 '____', u'zebra_grevys',
            ...                 u'bear_polar', u'bear_polar', 'TYPO', '____']
            >>> ensure = False
            >>> species_rowid_list = ibs.get_species_lblannot_rowid(species_list, ensure)
            >>> print(utool.list_str(list(zip(species_list, species_rowid_list))))
            >>> ensure = True
            >>> species_rowid_list = ibs.get_species_lblannot_rowid(species_list, ensure)
            >>> print(utool.list_str(list(zip(species_list, species_rowid_list))))
            >>> ibs.print_lblannot_table()

When super setup runs as root is builds all cpp modules as root

This causes the build directory in hesaff / pyrf / etc to have root permissions. Also the resutling lib file that is moved into these modules also has root permissions.

We need to be careful in fixing this because if you are calling setup.py develop and installing to the system python you will need root access, however if your python install prefix is in a local dir you don't need to do this.

I think a good fix would be passing in a --sudo flag to super_setup.py that calls unix_build without the sudo, but it calls python setup develop with sudo.

More Issues On Demo Run 12-31-2014

DONE * Remove checkboxes from encounter table
DONE * Remove encounter id from table
DONE * make selected encounter show encounter text
DONE * Indentify displays odd message
DONE * Refresh name table after incremental query is done (and durring query)
DONE * Switch to new encounter should switch to image table.
DONE * close interactive widget on finish of incremental query.
DONE * When there is one query and no exemplars no default name is given to the query

  • Try to get a good confidence threshold for suggestion
  • encounters should disappear on completion (filter valid eids by complete flag)
    (from top and bottom)

DONE * make scores (probabilities) show xxxx when they are not trustworty

  • Make query request object maintain state through multiple queries
  • Add add_data to QueryRequest which should in tern augment the indexer.
  • Add ability to add new points to multi-indexer. (by rebuilding the smallest tree)
  • Improve vsone scoring

Issue Plethora - from Chuck

Out of bounds ROIs are unable to be moved. (should snap into bounds)

Sometimes Annotations fail to delete in interact_annotation (when you hit accept
multiple times)

Not a match renames unknown candidates to two new names.

View only the exemplars as extra names in the name_interaction

name_interaction should not change data until confirm is hit.

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.