Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/LYiHub/AR-Mahjong-Assistant-preview
/ functions
Functions
193 in github.com/LYiHub/AR-Mahjong-Assistant-preview
⨍
Functions
193
◇
Types & classes
42
↳
Endpoints
8
↓ 46 callers
Method
update_state
Update state based on hidden hand and explicit meld inputs. Args: new_hand_input: Current hidden hand (Top half
server/mahjong_state_tracker.py:147
↓ 8 callers
Method
analyze_opportunities
Analyze opportunities for a waiting state hand: - Win list (if tenpai) - Watch list (Pon/Kan/Chi) - Keep list (based
server/efficiency_engine.py:288
↓ 6 callers
Method
_normalize_hand
Normalize input (hand or melds) to a list of 136-tile indices.
server/mahjong_state_tracker.py:88
↓ 6 callers
Method
calculate_best_discard
Calculate the best discard for a turn state hand. Args: hand_14: The current hidden hand (136-ID list). melds
server/efficiency_engine.py:90
↓ 6 callers
Function
get_db_connection
()
server/database.py:41
↓ 6 callers
Method
update_visible_tiles
Update visible tiles based on external events (e.g. from voice analysis). Events format: [{"type": "DISCARD", "tile": "5s"}, ...]
server/mahjong_state_tracker.py:25
↓ 5 callers
Method
_get_ukeire
Calculate Ukeire (effective tiles) considering global visible tiles. Returns: (total_count, list_of_tile_strings)
server/efficiency_engine.py:56
↓ 5 callers
Method
_to_34_array
Convert 136-tile format list to 34-tile count array.
server/efficiency_engine.py:38
↓ 5 callers
Method
release
(Context context)
rayneo arsdk for android doc/ExampleRecordTranslation.java:79
↓ 4 callers
Method
_get_full_hand_34
Combine hidden hand and melds into a 34-tile count array.
server/efficiency_engine.py:46
↓ 4 callers
Method
create
app/src/main/java/com/example/ai_assist/viewmodel/ChatViewModel.kt:89
↓ 3 callers
Method
_get_diff_tiles
Calculate newly added tiles (new_list - old_list) based on 34-tile types. Returns a list of 136-IDs representing the added tiles.
server/mahjong_state_tracker.py:119
↓ 3 callers
Function
convert_to_mpsz
Convert YOLO classes to MPSZ notation. Returns a tuple (hand_tiles, bonus_tiles).
server/main.py:91
↓ 3 callers
Method
detect_objects
Detect objects in an image file. Returns a list of dictionaries in the format: [ {'x': center_x, 'y': center_y, '
server/vision_service.py:37
↓ 3 callers
Function
format_suggestions
Format the efficiency engine result into a user-friendly string. Args: engine_result: The dictionary returned by calculate_best_disca
server/efficiency_engine.py:454
↓ 3 callers
Method
generate_lookup_table
Generate lookup table for all possible draws for a waiting state hand.
server/efficiency_engine.py:164
↓ 3 callers
Method
stop
app/src/main/java/com/example/ai_assist/utils/RayNeoAudioRecorder.kt:160
↓ 2 callers
Method
_simulate_meld_and_discard
Simulate declaring a meld (Pon/Chi) and finding the best discard. Args: full_hand_34: Current full hand counts.
server/efficiency_engine.py:233
↓ 2 callers
Function
check_alpha
(path)
tools/check_alpha.py:4
↓ 2 callers
Function
create_svg_wrapper
(png_path, svg_path)
tools/prepare_mahjong_svgs.py:37
↓ 2 callers
Function
draw_bounding_boxes
Draw bounding boxes on the image and save to output_path. Assumes predictions have x, y (center), width, height.
server/vision_service.py:94
↓ 2 callers
Method
infer
Run inference on a frame
server/yolo_inference.py:93
↓ 2 callers
Method
mapListToUnicode
app/src/main/java/com/example/ai_assist/utils/MahjongMapper.kt:47
↓ 2 callers
Method
setUp
(self)
server/tests/test_mahjong_tracker_advanced.py:6
↓ 2 callers
Method
start
(Context context, File recordingFile, int sampleRateInHz, int channelConfig, int audioFormat, int bufferSizeIn
rayneo arsdk for android doc/ExampleRecordTranslation.java:28
↓ 2 callers
Method
start
app/src/main/java/com/example/ai_assist/utils/RayNeoAudioRecorder.kt:38
↓ 1 callers
Method
StartSub
(AudioRecord audioRecord, File recordingFile)
rayneo arsdk for android doc/ExampleRecordTranslation.java:59
↓ 1 callers
Method
_generate_random_hand_from_34
Generate a random hand ensuring max 4 of each tile type.
server/tests/test_efficiency_simulation.py:18
↓ 1 callers
Method
_initialize_model
(self)
server/vision_service.py:23
↓ 1 callers
Method
analyzeHand
app/src/main/java/com/example/ai_assist/service/GameApiService.kt:20
↓ 1 callers
Method
analyzeImage
app/src/main/java/com/example/ai_assist/repository/ChatRepository.kt:30
↓ 1 callers
Method
analyze_game_events
Analyze transcribed text to extract Mahjong game events. Returns a list of events like: [{"type": "DISCARD", "tile": "5s"}]
server/llm_service.py:22
↓ 1 callers
Function
benchmark
()
server/performance_test.py:107
↓ 1 callers
Function
draw_bounding_boxes
(image_path: str, predictions: list, output_path: str)
server/tests/test_drawing.py:13
↓ 1 callers
Method
endCurrentSession
app/src/main/java/com/example/ai_assist/viewmodel/ChatViewModel.kt:61
↓ 1 callers
Method
endSession
app/src/main/java/com/example/ai_assist/service/GameApiService.kt:34
↓ 1 callers
Function
format_opportunities
(opportunities)
server/performance_test.py:43
↓ 1 callers
Function
main
()
tools/prepare_mahjong_svgs.py:53
↓ 1 callers
Function
main
()
server/camera_demo.py:7
↓ 1 callers
Function
main
()
server/verify_hand.py:10
↓ 1 callers
Method
mapToUnicode
app/src/main/java/com/example/ai_assist/utils/MahjongMapper.kt:29
↓ 1 callers
Function
monitor_inactive_sessions
Background task to close inactive sessions every 60 seconds.
server/main.py:491
↓ 1 callers
Method
onImageCaptured
app/src/main/java/com/example/ai_assist/service/RayNeoDeviceManager.kt:15
↓ 1 callers
Method
onVoiceResult
app/src/main/java/com/example/ai_assist/service/RayNeoDeviceManager.kt:14
↓ 1 callers
Method
preprocess
Preprocess image: Letterbox resize, normalize, CHW
server/yolo_inference.py:57
↓ 1 callers
Method
processAudio
app/src/main/java/com/example/ai_assist/service/GameApiService.kt:27
↓ 1 callers
Function
run_complex_analysis
(engine)
server/performance_test.py:73
↓ 1 callers
Function
run_test
()
server/tests/test_llm_connection.py:14
↓ 1 callers
Method
startNewSession
app/src/main/java/com/example/ai_assist/viewmodel/ChatViewModel.kt:56
↓ 1 callers
Method
startSession
app/src/main/java/com/example/ai_assist/service/GameApiService.kt:17
↓ 1 callers
Function
test_analyze
()
server/verify_sample_2.py:9
↓ 1 callers
Function
test_api
()
server/tests/test_api_conversion.py:8
↓ 1 callers
Function
test_chi_details
()
server/tests/test_chi_details.py:10
↓ 1 callers
Function
test_efficiency
()
test_efficiency.py:4
↓ 1 callers
Function
test_gang_plus_discard
()
reproduce_issue.py:4
↓ 1 callers
Function
test_workflow
()
server/verify_changes.py:8
↓ 1 callers
Method
transcribe
Transcribe audio file to text using faster-whisper. Raises Exception if STT fails or not available.
server/stt_service.py:34
↓ 1 callers
Method
uploadAudio
app/src/main/java/com/example/ai_assist/viewmodel/ChatViewModel.kt:78
↓ 1 callers
Method
uploadPhoto
app/src/main/java/com/example/ai_assist/viewmodel/ChatViewModel.kt:68
Method
__init__
(self)
server/mahjong_state_tracker.py:14
Method
__init__
(self)
server/efficiency_engine.py:7
Method
__init__
(self, model="base", language="zh")
server/stt_service.py:15
Method
__init__
Initialize YOLOv8 ONNX Inference Args: input_size: Optional tuple (width, height) to force specific inference si
server/yolo_inference.py:10
Method
__init__
Initialize the Vision Service with a local YOLO model.
server/vision_service.py:11
Method
__init__
(self, api_key: str = None, base_url: str = None, model: str = "gpt-4o")
server/llm_service.py:11
Method
addition_isCorrect
app/src/test/java/com/example/ai_assist/ExampleUnitTest.kt:13
Function
analyze_hand
( image: UploadFile = File(...), session_id: str = Form(...), incoming_tile: Optional[str] = Form(
server/main.py:149
Method
checkPermissions
app/src/main/java/com/example/ai_assist/MainActivity.kt:143
Method
chooseOptimalSize
app/src/main/java/com/example/ai_assist/MainActivity.kt:522
Method
clearGameData
app/src/main/java/com/example/ai_assist/MainActivity.kt:401
Method
closeCamera
rayneo arsdk for android doc/Camera_sample_code/CameraActivity.kt:230
Method
closeCamera
app/src/main/java/com/example/ai_assist/MainActivity.kt:731
Function
close_inactive_sessions
Close sessions that have been inactive for more than timeout_seconds. Returns list of closed session IDs.
server/database.py:150
Method
configureTransform
app/src/main/java/com/example/ai_assist/MainActivity.kt:453
Function
convert_to_mpsz
(yolo_classes)
server/performance_test.py:23
Function
create_or_update_session
(session_id: str)
server/database.py:46
Function
debug_yolo
( image: UploadFile = File(...), conf_threshold: float = Form(0.54), iou_threshold: float = Form(0
server/main.py:445
Method
endSession
app/src/main/java/com/example/ai_assist/repository/ChatRepository.kt:56
Function
end_session
(session_id: str)
server/database.py:70
Function
end_session
(request: EndSessionRequest)
server/main.py:424
Method
flushBufferToFile
app/src/main/java/com/example/ai_assist/utils/RayNeoAudioRecorder.kt:137
Method
formatMahjongText
app/src/main/java/com/example/ai_assist/MainActivity.kt:297
Function
get_all_sessions
()
server/database.py:107
Function
get_current_memory_mb
Get current memory usage in MB.
server/performance_test.py:37
Function
get_history_details
(session_id: str)
server/main.py:438
Function
get_history_sessions
()
server/main.py:434
Function
get_session_details
(session_id: str)
server/database.py:115
Method
handleDoubleClick
app/src/main/java/com/example/ai_assist/MainActivity.kt:345
Method
handleKeyEvent
app/src/main/java/com/example/ai_assist/service/RayNeoDeviceManager.kt:57
Method
handleSwipeBackward
app/src/main/java/com/example/ai_assist/MainActivity.kt:390
Method
handleSwipeForward
app/src/main/java/com/example/ai_assist/MainActivity.kt:369
Method
handleTripleClick
app/src/main/java/com/example/ai_assist/MainActivity.kt:349
Method
has_hidden
(idx)
server/efficiency_engine.py:381
Method
imageToBitmap
rayneo arsdk for android doc/Camera_sample_code/CameraActivity.kt:254
Function
init_db
()
server/database.py:10
Function
log_interaction
(session_id: str, image_path: str, steps: List[str], response: Dict)
server/database.py:84
Method
observeViewModel
app/src/main/java/com/example/ai_assist/MainActivity.kt:248
Method
onConfigureFailed
rayneo arsdk for android doc/Camera_sample_code/CameraActivity.kt:223
Method
onConfigureFailed
app/src/main/java/com/example/ai_assist/MainActivity.kt:689
Method
onConfigured
rayneo arsdk for android doc/Camera_sample_code/CameraActivity.kt:218
next →
1–100 of 193, ranked by callers