본문 바로가기
728x90
반응형
SMALL

코틀린18

[Object Detection] 안드로이드 TensorFlow Lite를 사용하여 커스텀 객체 탐지 모델 빌드 및 배포 (3) 탐지 프로그램에 피드 이미지 다음 코드를 fun runObjectDetection(bitmap:Bitmap)에 추가한다. 이렇게 하면 이미지가 탐지 프로그램에 전달된다. // Step 3: feed given image to the model and print the detection result val results = detector.detect(image) 완료되면 탐지기는 Detection 목록을 반환하며, 각 목록에는 모델이 이미지에서 발견한 객체에 대한 정보가 포함된다. 각 객체에 대한 설명은 다음과 같다. boundingBox : 이미지 내에서 객체의 존재와 위치를 선언하는 직사각형 categories : 객체의 종류 및 탐지 결과에 대한 모델의 신뢰도이다. 이 모델은 여러 카테고리를 반환하.. 2023. 6. 16.
[Object Detection] 안드로이드 TensorFlow Lite를 사용하여 커스텀 객체 탐지 모델 빌드 및 배포 (2) 사전 학습된 TFLite 객체 탐지 모델 TensorFlow Hub에는 사용할 수 있는 몇 가지 객체 탐지 모델 있다. COCO 2017 데이터 세트에서 학습되고 TFLite에 최적화되고 모바일 CPU, GPU의 성능에 맞게 설계된 EfficientDet-Lite 객체 탐지 모델을 다운로드한다. TFLite 작업 라이브러리를 사용하여 선행 학습된 TFLite 모델을 시작 앱에 통합한다. TFLite 작업 라이브러리를 사용하면 모바일에 최적화된 머신러닝 모델을 모바일 앱에 쉽게 통합할 수 있다. 객체 감지, 이미지 분류, 텍스트 분류를 비롯하여 널리 사용되는 머신러닝 사용 사례를 많이 지원합니다. 코드 몇 줄로 TFLite 모델을 로드하고 실행할 수 있다. 모델 추가 안드로이드 프로젝트에서 assets 폴.. 2023. 6. 16.
[Object Detection] 안드로이드 TensorFlow Lite를 사용하여 커스텀 객체 탐지 모델 빌드 및 배포 (1) TensorFlow Lite TensorFlow는 자동차, 오렌지와 같은 일반적인 객체를 감지할 수 있는 선행 학습된 모바일 최적화 모델을 제공한다. 단 몇 줄의 코드로 모바일 앱에 선행 학습된 모델을 통합할 수 있다. 하지만 더 뚜렷하고 이례적인 카테고리의 객체를 감지해야 하거나 필요할 수 있다. 자체 학습 이미지를 수집한 다음 자체 객체 감지 모델을 학습시키고 배포해야 한다. TensorFlow Lite는 Android 및 iOS 휴대기기를 비롯한 에지 기기에서 머신러닝 모델을 실행하도록 최적화된 크로스 플랫폼 머신러닝 라이브러리이다. TensorFlow Lite는 ML Kit에서 머신러닝 모델을 실행하는 데 사용되는 핵심 엔진이다. TensorFlow Lite 생태계에는 휴대기기에서 머신러닝 모델을.. 2023. 6. 16.
[Kotlin] Decorator (Material CalendarView) Decorator decorator 클래스를 선언하여 토요일, 일요일, 오늘에 대한 뷰 커스텀이 가능하다. class main : AppCompatActivity() { val binding by lazy { ActivityMainBinding.inflate(layoutInflater)} lateinit var calendar: MaterialCalendarView private var Today = CalendarDay.today() override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(binding.root) val calendar = binding.calendarview.. 2023. 1. 19.
[Kotlin] Material CalendarView Material CalendarView Material CalendarView는 Android의 CalendarView의 머티리얼 디자인 백 포트이다. build.gradle implementation 'com.prolificinteractive:material-calendarview:1.4.3' strings.xml 일 월 화 수 목 금 토 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월 xml kt class main : AppCompatActivity() { val binding by lazy { ActivityMainBinding.inflate(layoutInflater)} lateinit var calendar: MaterialCalendarView override fun .. 2023. 1. 19.
[Kotlin] timePicker timePicker 타임피커는 사용자가 시간을 선택하도록 하는 위젯이다. 타임피커는 clock과 spinner 모드가 있다. xml kt import android.content.Intent import android.os.Bundle import androidx.appcompat.app.AppCompatActivity class time : AppCompatActivity() { val binding by lazy { ActivityMainBinding.inflate(layoutInflater)} override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(binding.root).. 2023. 1. 17.
[Kotlin] 구글 자동 로그인 구글 자동 로그인 클라이언트 (파이어베이스)에 저장되어있는 해당 유저의 idToken과 현재 사용자 정보를 비교하여 참이면 바로 로그인을 실행한다. import android.content.Intent import android.os.Bundle import android.view.animation.AnimationUtils import android.widget.ImageView import androidx.activity.result.contract.ActivityResultContracts import androidx.appcompat.app.AppCompatActivity import com.google.android.gms.auth.api.signin.GoogleSignIn import com... 2023. 1. 15.
[Kotlin] 파이어베이스 구글 로그인 파이어베이스 구글 로그인 파이어베이스는 구글 (Google)이 소유하고 있는 모바일 애플리케이션 개발 플랫폼이다. 구글 로그인 인증을 구현하기 위해 파이어베이스 구성 파일과 SDK를 추가한다. 프로젝트를 위해 login 페이지와 login 후의 페이지를 구성한다. build.gradle implementation platform('com.google.firebase:firebase-bom:31.1.1') implementation 'com.google.firebase:firebase-auth-ktx:21.1.0' implementation 'com.google.firebase:firebase-storage-ktx:20.0.1' implementation 'com.google.firebase:firebas.. 2023. 1. 15.
[Kotlin] 파이어베이스 (Firebase) 파이어베이스 (Firebase) 파이어베이스는 구글 (Google)이 소유하고 있는 모바일 애플리케이션 개발 플랫폼이다. Firebase 프로젝트 https://console.firebase.google.com/u/0/?hl=ko에서 프로젝트를 추가한다. 그 다음 프로젝트 설정을 클릭한다. Firebase 추가 앱 추가를 클릭하고 안드로이드 아이콘을 클릭한다. 안드로이드 프로젝트 생성할 때 나오는 패키지를 입력하고 SHA-1 인증서를 등록한다. 키를 찾는 방법은 https://goatlab.tistory.com/1063를 참고한다. 그 다음 google-services.json 파일을 다운 후 안드로이드 프로젝트의 app 폴더에 이동시킨다. 2023. 1. 15.
[Kotlin] ImageView ImageView ImageView는 비트맵 (BitMap) 또는 Drawable 리소스 등의 이미지 리소스를 그리는 뷰 (View)이다. android:src – 출력될 이미지 지정 maxWidth, maxHeight - 화면에 출력될 뷰의 최대 사이즈 지정 adjustViewBounds – 종횡비 유지 scaleType ImageView에 출력되는 이미지 비율, 크기를 설정한다. center : 이미지 원본 사이즈 유지, 이미지 중앙을 ImageView에 출력 centerCrop : 이미지의 가로/세로 중 짧은 쪽을 ImageView에 꽉 차게 출력 centerInside : 이미지의 가로/세로 중 긴 쪽을 ImageView에 꽉 차게 출력 fitStart : 가로/세로 비율을 유지하여 ImageVi.. 2023. 1. 12.
728x90
반응형
LIST