All Projects → SirLYC → Imagelabelview

SirLYC / Imagelabelview

Licence: mit
A view for data-labeling(a tool for machine learning).

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Imagelabelview

Freepager
ViewPagers library for Android
Stars: ✭ 461 (+2205%)
Mutual labels:  custom-view
Easysignseekbar
本库主要提供一个漂亮而强大的自定义SeekBar,进度变化由提示牌 (sign)展示,具有强大的属性设置,支持设置section(节点)、mark(标记)、track(轨迹)、thumb(拖动块)、progress(进度)、sign(提示框)等功能
Stars: ✭ 629 (+3045%)
Mutual labels:  custom-view
Draggableflagview
可拖拽的红点,(仿新版QQ,tab下面拖拽标记为已读的效果),拖拽一定的距离可以消失回调。
Stars: ✭ 811 (+3955%)
Mutual labels:  custom-view
Passcodeview
Material Design PasscodeView for Android.
Stars: ✭ 513 (+2465%)
Mutual labels:  custom-view
Xrecyclerview
A RecyclerView that implements pullrefresh and loadingmore featrues.you can use it like a standard RecyclerView
Stars: ✭ 5,269 (+26245%)
Mutual labels:  custom-view
Creditcardview
💳 CreditCardView is an Android library that allows developers to create the UI which replicates an actual Credit Card.
Stars: ✭ 744 (+3620%)
Mutual labels:  custom-view
Widgetcase
自定义控件模块库:各种风格的自定义控件,拿来就用,API文档详细,持续集成,长期维护,有问必答;
Stars: ✭ 440 (+2100%)
Mutual labels:  custom-view
Iconswitch
🍭 Custom Android Switch widget
Stars: ✭ 874 (+4270%)
Mutual labels:  custom-view
Freedrawview
A View on which you can freely draw, customizing paint width, alpha and color, and take a screenshot of the content. Useful for note apps, signatures or free hand writing.
Stars: ✭ 627 (+3035%)
Mutual labels:  custom-view
Labelsview
Android的标签列表控件。可以设置标签的选中效果。 可以设置标签的选中类型:不可选中、单选、限数量多选和不限数量多选等, 并支持设置必选项、单行显示、最大显示行数等功能。
Stars: ✭ 777 (+3785%)
Mutual labels:  custom-view
Stateview
✨ StateView is an invisible, zero-sized View that can be used to lazily inflate loadingView/emptyView/retryView at runtime.
Stars: ✭ 573 (+2765%)
Mutual labels:  custom-view
Gameplane
基于Android的仿微信打飞机游戏
Stars: ✭ 592 (+2860%)
Mutual labels:  custom-view
Codeview Android
Display code with syntax highlighting ✨ in native way.
Stars: ✭ 748 (+3640%)
Mutual labels:  custom-view
Crunchycalendar
A beautiful material calendar with endless scroll, range selection and a lot more!
Stars: ✭ 465 (+2225%)
Mutual labels:  custom-view
Statefullayout
Android layout to show template for loading, empty, error etc. states
Stars: ✭ 813 (+3965%)
Mutual labels:  custom-view
Easysegmentedbarview
本库主要提供一个简单易用的自定义分段控件,方便快速实现分段效果,支持xml配置、代码配置、分段规则按均分/比例分、数字分段、文本分段、渐变分段、bar条样式正常/圆形/三角形,segment文字样式、进度设置、进度标记类型设置、分段描述设置、其它更多自定义设置等功能。
Stars: ✭ 455 (+2175%)
Mutual labels:  custom-view
Fogview library
FogView is a android library that can show fog on any layout and the fog removes when user rubs it.
Stars: ✭ 633 (+3065%)
Mutual labels:  custom-view
Ancustomview
Blog for @IBDesignable and @IBInspectable in Swift for make Custom View.
Stars: ✭ 14 (-30%)
Mutual labels:  custom-view
Androidall
Android 程序员需要掌握的技术栈:数据结构算法、程序架构、设计模式、性能优化、插件化、热更新、Kotlin、NDK、Jetpack,以及常用的开源框架源码分析如 Flutter、Router、RxJava、Glide、LeakCanary、Dagger2、Retrofit、OkHttp、ButterKnife 等
Stars: ✭ 849 (+4145%)
Mutual labels:  custom-view
Statusview
Custom status view for Android.
Stars: ✭ 775 (+3775%)
Mutual labels:  custom-view

ImageLabelView

简体中文 | My Blog(Chinese)

A view for data-labeling(a tool for machine learning).

1 2

Install

Step 1. Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Step 2. Add the dependency

dependencies {
    implementation 'com.github.SirLYC:ImageLabelView:{latest version}'
}

Use

You can check sample code here

Step1. Add to your layout

Step2. Set a LabelCreator The labelCreator is used when you draw a new label. It can create a new label via its createLabel() method. First, you need to implement a

ImageLabelView#LabelCreator. 

There is a simple implementation in sample code for rect label:

label.labelCreator = object : ImageLabelView.LabelCreator {
            override fun createLabel(): RectLabel {
                return RectLabel()
            }
        }

Remember to set it to set it to ImageLabelView's labelCreator.

You can create any type of Label which may return different kinds of data.

Step3. Set an image to the view

Set a bitmap to the ImageLabelView, and it will start to show this phone like a imageView with center inside mode. The bitmap can be null, which will let the view clear old labels...

val bitmap: Bitmap? = ... // download or read from disk
label.setBitmap(bitmap)

Step4. Do your job in different mode

When a nonnull bitmap is present, there are 4 modes to operate a image.

  • PREVIEW
    This is default mode. Everytime a new bitmap is set to this view, the mode will change to it. In this mode, you can move or scale the image to the perfect position and size for labelling.
  • DRAW
    In this mode, you can draw a new label. Take rectangle for example. When your finger touch the screen and move, there will be a rectangle right on the image whose left and top is your start posintion and right and bottom is your end position. After your finger up, the view will immediately change to SELECT mode.
  • UPDATE
    In this mode, you can resize or change label's position. Take rectangle for example, you can drag a regtangle' vertext or a egde to resize it, or move the whole of the rectange (when your finger down right in the rectangle).
  • SELECT
    When click or long press, a rectangle at your finger's position will be selected (if drawing end, the new-created label will be selected automatically.). When a label is selected, you can get it by
label.selectingLabel()

At this time, you may let user to input or do other things to change the message of the label or just delete it.

Step5. Export your data Just get the label and call it's getData() or get its message property!

Todo/Fix

  • [x] fix multi-selection problem when tap once
  • [ ] fix state loss after config changes (such as screen orientation, languages...)
  • [ ] circle label
  • [ ] triangle label
  • [ ] other polygon label...

License

MIT License

Copyright (c) 2019 Liu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].