Large-scale computing backend for Jupyter notebooks - HTCondor batch job submission and monitoring using the Ganga toolkit
Mentors:
- Ulrik Egede
- Jakub Moscicki
| """ | |
| Copyright (c) 2019-present NAVER Corp. | |
| MIT License | |
| """ | |
| # -*- coding: utf-8 -*- | |
| import base64 | |
| import cv2 | |
| import numpy as np |
| <uses-permission android:name="android.permission.CAMERA"/> |
| <application ...> | |
| ... | |
| <meta-data | |
| android:name="com.google.firebase.ml.vision.DEPENDENCIES" | |
| android:value="ocr" /> | |
| </application> |
| dependencies { | |
| // ... implementation 'com.google.firebase:firebase-ml-vision:24.0.3' | |
| } |
| public class MainActivity extends AppCompatActivity implements SurfaceHolder.Callback { | |
| TextView textView; | |
| PreviewView mCameraView; | |
| SurfaceHolder holder; | |
| SurfaceView surfaceView; | |
| Canvas canvas; | |
| Paint paint; | |
| int cameraHeight, cameraWidth, xOffset, yOffset, boxWidth, boxHeight; | |
| private ListenableFuture<ProcessCameraProvider> cameraProviderFuture; |
| private int degreesToFirebaseRotation(int degrees) { | |
| switch (degrees) { | |
| case 0: | |
| return FirebaseVisionImageMetadata.ROTATION_0; | |
| case 90: | |
| return FirebaseVisionImageMetadata.ROTATION_90; | |
| case 180: | |
| return FirebaseVisionImageMetadata.ROTATION_180; | |
| case 270: | |
| return FirebaseVisionImageMetadata.ROTATION_270; |
| ... | |
| //Image Analysis Function | |
| //Set static size according to your device or write a dynamic function for it | |
| ImageAnalysis imageAnalysis = | |
| new ImageAnalysis.Builder() | |
| .setTargetResolution(new Size(720, 1488)) | |
| .setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST) | |
| .build(); | |
| PreviewView mCameraView; | |
| SurfaceHolder holder; | |
| SurfaceView surfaceView; | |
| Canvas canvas; | |
| Paint paint; | |
| int cameraHeight, cameraWidth, xOffset, yOffset, boxWidth, boxHeight; | |
| private ListenableFuture<ProcessCameraProvider> cameraProviderFuture; | |
| private ExecutorService executor = Executors.newSingleThreadExecutor(); |
| <SurfaceView | |
| android:id="@+id/overlay" | |
| android:layout_width="0dp" | |
| android:layout_height="0dp" | |
| app:layout_constraintBottom_toBottomOf="parent" | |
| app:layout_constraintEnd_toEndOf="parent" | |
| app:layout_constraintStart_toStartOf="parent" | |
| app:layout_constraintTop_toTopOf="parent" /> | |
| <androidx.camera.view.PreviewView |