Spaces:
Runtime error
Runtime error
Ivan Felipe Rodriguez commited on
Commit ·
4809f98
1
Parent(s): 03ba546
adding colors to palette
Browse files- app.py +4 -1
- inference.py +1 -1
app.py
CHANGED
|
@@ -84,4 +84,7 @@ with gr.Blocks() as demo:
|
|
| 84 |
process_video_btn.click(process_video, input_video, [processed_frames, original_frames, output_video])
|
| 85 |
|
| 86 |
demo.queue()
|
| 87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
process_video_btn.click(process_video, input_video, [processed_frames, original_frames, output_video])
|
| 85 |
|
| 86 |
demo.queue()
|
| 87 |
+
if os.getenv('SYSTEM') == 'spaces':
|
| 88 |
+
demo.launch(width='40%',auth=(os.environ.get('SHARK_USERNAME'), os.environ.get('SHARK_PASSWORD')))
|
| 89 |
+
else:
|
| 90 |
+
demo.launch()
|
inference.py
CHANGED
|
@@ -86,7 +86,7 @@ register_all_modules()
|
|
| 86 |
|
| 87 |
# build the model from a config file and a checkpoint file
|
| 88 |
model = init_detector(config_file, checkpoint_file, device='cuda:0') # or device='cuda:0'
|
| 89 |
-
model.dataset_meta['palette'] = model.dataset_meta['palette'] + model.dataset_meta['palette'][
|
| 90 |
model.dataset_meta['classes'] = classes
|
| 91 |
print(model.cfg.visualizer)
|
| 92 |
# init visualizer(run the block only once in jupyter notebook)
|
|
|
|
| 86 |
|
| 87 |
# build the model from a config file and a checkpoint file
|
| 88 |
model = init_detector(config_file, checkpoint_file, device='cuda:0') # or device='cuda:0'
|
| 89 |
+
model.dataset_meta['palette'] = model.dataset_meta['palette'] + model.dataset_meta['palette'][-23:]
|
| 90 |
model.dataset_meta['classes'] = classes
|
| 91 |
print(model.cfg.visualizer)
|
| 92 |
# init visualizer(run the block only once in jupyter notebook)
|