Spaces:
Paused
Paused
Commit History
-
Update main.py
Verified signature5e78887 -
Update README.md
Verified signature9206800 -
Update main.py
Verified signatureb84f01e
-
Update static/index.html
Verified signature26cc82f -
Update static/index.html
Verified signature91b9c63 -
Update static/index.html
Verified signature504893b -
Create index.html
Verified signaturef143ca4 -
Rename static/index.html to static/index2.html
Verified signature4c53b5b -
Create index3.html
Verified signature84996cc
-
Update main.py
Verified signaturecc0b0fb -
Update requirements.txt
Verified signaturede989b6 -
Update main.py
Verified signature0151799 -
Update README.md
Verified signature3dcb212 -
Update main.py
Verified signature9078bae
-
Update main.py
Verified signaturedc92239 -
Update main.py
Verified signaturec1e41b5
-
Update static/index.html
Verified signaturedeecb8f -
Update static/index.html
Verified signature35a00c4 -
Update static/index.html
Verified signature92995c2 -
Create index.html
Verified signatureb59a098 -
Rename static/index.html to static/index1.html
Verified signature7347ecd -
Update README.md
Verified signature732c1a0
-
Update static/index.html
Verified signature4807797 -
Update static/index.html
Verified signature5663e02 -
Update static/index.html
Verified signature8c72911 -
Update main.py
Verified signature215cdaf -
Update main.py
Verified signaturebff39e2 -
Update main.py
Verified signatureae9a263 -
Update main.py
Verified signatureb396701 -
Rename static/static_index (12).html to static/index.html
Verified signature2f99a90 -
Delete static/index.html
Verified signature382da18 -
Upload static_index (12).html
Verified signature55450db -
Rename index.html to static/index.html
Verified signature1140f00 -
Rename static/static_index (12).html to index.html
Verified signature0fb1caa -
Delete static/index.html
Verified signature611a02e -
Upload static_index (12).html
Verified signature13ed926 -
Update static/index.html
Verified signaturee00db0c -
Update main.py
Verified signature2371a34 -
Update main.py
Verified signaturee120bd1 -
Update main.py
Verified signaturef3e6112 -
Update main.py
Verified signature53afd1c -
Update main.py
Verified signature6629a2a -
Update main.py
Verified signature3ea497c -
Update main.py
Verified signature6ebd507 -
Update static/index.html
Verified signature58746b4 -
Update main.py
Verified signature29da619
-
Update static/index.html
Verified signaturecd5b455 -
Update main.py
Verified signaturefrom fastapi import FastAPI, File, UploadFile, HTTPException from fastapi.responses import JSONResponse from gradio_client import Client app = FastAPI() client = Client("https://ashrafb-image-to-sketch.hf.space/") @app.post("/predict") async def predict(file: UploadFile = File(...)): try: # Save the uploaded image to a temporary file with NamedTemporaryFile(delete=False) as tmp: shutil.copyfileobj(file.file, tmp) tmp_path = tmp.name # Call the Gradio client to predict result = client.predict(tmp_path, api_name="/predict") # Delete the temporary file os.unlink(tmp_path) # Parse and return the result sketch_image_url, result_file_url = result return JSONResponse(content={"sketch_image_url": sketch_image_url, "result_file_url": result_file_url}, status_code=200) except Exception as e: raise HTTPException(status_code=500, detail=str(e))d480925 -
Update main.py
Verified signaturefrom fastapi import FastAPI, File, UploadFile from fastapi.responses import StreamingResponse from gradio_client import Client app = FastAPI() client = Client("https://ashrafb-image-to-sketch.hf.space/") @app.post("/predict") async def predict_sketch(file: UploadFile = File(...)): content = await file.read() # Call the Gradio client to get the sketch result result = client.predict(content, api_name="/predict") sketch_image_bytes = result[0].encode('utf-8') # Assuming result[0] is a base64 encoded image return StreamingResponse(io.BytesIO(sketch_image_bytes), media_type="image/png")d571b45 -
Update static/index.html
Verified signature4d1d14d